This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fetch magic on the first stacked filetest, not the last
[perl5.git] / t / loc_tools.pl
1 # Common tools for test files to find the locales which exist on the
2 # system.  Caller should have verified that this isn't miniperl before calling
3 # the functions.
4
5 # Note that it's okay that some languages have their native names
6 # capitalized here even though that's not "right".  They are lowercased
7 # anyway later during the scanning process (and besides, some clueless
8 # vendor might have them capitalized erroneously anyway).
9
10 # Functions whose names begin with underscore are internal helper functions
11 # for this file, and are not to be used by outside callers.
12
13 use Config;
14 use strict;
15 use warnings;
16 use feature 'state';
17
18 eval { require POSIX; import POSIX 'locale_h'; };
19 my $has_locale_h = ! $@;
20
21 my @known_categories = ( qw(LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY
22                             LC_NUMERIC LC_TIME LC_ADDRESS LC_IDENTIFICATION
23                             LC_MEASUREMENT LC_PAPER LC_TELEPHONE LC_SYNTAX
24                             LC_TOD));
25 my @platform_categories;
26
27 # LC_ALL can be -1 on some platforms.  And, in fact the implementors could
28 # legally use any integer to represent any category.  But it makes the most
29 # sense for them to have used small integers.  Below, we create new locale
30 # numbers for ones missing from this machine.  We make them very negative,
31 # hopefully more negative than anything likely to be a valid category on the
32 # platform, but also below is a check to be sure that our guess is valid.
33 my $max_bad_category_number = -1000000;
34
35 # Initialize this hash so that it looks like e.g.,
36 #   6 => 'CTYPE',
37 # where 6 is the value of &POSIX::LC_CTYPE
38 my %category_name;
39 my %category_number;
40 if ($has_locale_h) {
41     my $number_for_missing_category = $max_bad_category_number;
42     foreach my $name (@known_categories) {
43         my $number = eval "&POSIX::$name";
44         if ($@) {
45             # Use a negative number (smaller than any legitimate category
46             # number) if the platform doesn't support this category, so we
47             # have an entry for all the ones that might be specified in calls
48             # to us.
49             $number = $number_for_missing_category-- if $@;
50         }
51         elsif (   $number !~ / ^ -? \d+ $ /x
52                || $number <=  $max_bad_category_number)
53         {
54             # We think this should be an int.  And it has to be larger than
55             # any of our synthetic numbers.
56             die "Unexpected locale category number '$number' for $name"
57         }
58         else {
59             push @platform_categories, $name;
60         }
61
62         $name =~ s/LC_//;
63         $category_name{$number} = "$name";
64         $category_number{$name} = $number;
65     }
66 }
67
68 sub _my_diag($) {
69     my $message = shift;
70     if (defined &main::diag) {
71         diag($message);
72     }
73     else {
74         local($\, $", $,) = (undef, ' ', '');
75         print STDERR $message, "\n";
76     }
77 }
78
79 sub _my_fail($) {
80     my $message = shift;
81     if (defined &main::fail) {
82         fail($message);
83     }
84     else {
85         local($\, $", $,) = (undef, ' ', '');
86         print "not ok 0 $message\n";
87     }
88 }
89
90 sub _trylocale ($$$$) { # For use only by other functions in this file!
91
92     # Adds the locale given by the first parameter to the list given by the
93     # 3rd iff the platform supports the locale in each of the category numbers
94     # given by the 2nd parameter, which is either a single category or a
95     # reference to a list of categories.  The list MUST be sorted so that
96     # CTYPE is first, COLLATE is last unless ALL is present, in which case
97     # that comes after COLLATE.  This is because locale.c detects bad locales
98     # only with CTYPE, and COLLATE on some platforms can core dump if it is a
99     # bad locale.
100     #
101     # The 4th parameter is true if to accept locales that aren't apparently
102     # fully compatible with Perl.
103
104     my $locale = shift;
105     my $categories = shift;
106     my $list = shift;
107     my $allow_incompatible = shift;
108
109     return if ! $locale || grep { $locale eq $_ } @$list;
110
111     # This is a toy (pig latin) locale that is not fully implemented on some
112     # systems
113     return if $locale =~ / ^ pig $ /ix;
114
115     # Certain platforms have a crippled locale system in which setlocale
116     # returns success for just about any possible locale name, but if anything
117     # actually happens as a result of the call, it is that the underlying
118     # locale is set to a system default, likely C or C.UTF-8.  We can't test
119     # such systems fully, but we shouldn't disable the user from using
120     # locales, as it may work out for them (or not).
121     return if    defined $Config{d_setlocale_accepts_any_locale_name}
122               && $locale !~ / ^ (?: C | POSIX | C\.UTF-8 ) $/ix;
123
124     $categories = [ $categories ] unless ref $categories;
125
126     my $badutf8 = 0;
127     my $plays_well = 1;
128
129     use warnings 'locale';
130
131     local $SIG{__WARN__} = sub {
132         $badutf8 = 1 if grep { /Malformed UTF-8/ } @_;
133         $plays_well = 0 if grep {
134                     /Locale .* may not work well(?#
135                    )|The Perl program will use the expected meanings/i
136             } @_;
137     };
138
139     # Incompatible locales aren't warned about unless using locales.
140     use locale;
141
142     foreach my $category (@$categories) {
143         die "category '$category' must instead be a number"
144                                             unless $category =~ / ^ -? \d+ $ /x;
145
146         return unless setlocale($category, $locale);
147         last if $badutf8 || ! $plays_well;
148     }
149
150     if ($badutf8) {
151         _my_fail("Verify locale name doesn't contain malformed utf8");
152         return;
153     }
154     push @$list, $locale if $plays_well || $allow_incompatible;
155 }
156
157 sub _decode_encodings { # For use only by other functions in this file!
158     my @enc;
159
160     foreach (split(/ /, shift)) {
161         if (/^(\d+)$/) {
162             push @enc, "ISO8859-$1";
163             push @enc, "iso8859$1";     # HP
164             if ($1 eq '1') {
165                  push @enc, "roman8";   # HP
166             }
167             push @enc, $_;
168             push @enc, "$_.UTF-8";
169             push @enc, "$_.65001"; # Windows UTF-8
170             push @enc, "$_.ACP"; # Windows ANSI code page
171             push @enc, "$_.OCP"; # Windows OEM code page
172             push @enc, "$_.1252"; # Windows
173         }
174     }
175     if ($^O eq 'os390') {
176         push @enc, qw(IBM-037 IBM-819 IBM-1047);
177     }
178     push @enc, "UTF-8";
179     push @enc, "65001"; # Windows UTF-8
180
181     return @enc;
182 }
183
184 sub valid_locale_categories() {
185     # Returns a list of the locale categories (expressed as strings, like
186     # "LC_ALL) known to this program that are available on this platform.
187
188     return @platform_categories;
189 }
190
191 sub locales_enabled(;$) {
192     # If no parameter is specified, the function returns 1 if there is any
193     # "safe" locale handling available to the caller; otherwise 0.  Safeness
194     # is defined here as the caller operating in the main thread of a program,
195     # or if threaded locales are safe on the platform and Configured to be
196     # used.  This sub is used for testing purposes, and for those, this
197     # definition of safety is sufficient, and necessary to get some tests to
198     # run on certain configurations on certain platforms.  But beware that the
199     # main thread can change the locale of any subthreads unless
200     # ${^SAFE_LOCALES} is non-zero.
201     #
202     # Use the optional parameter to discover if a particular category or
203     # categories are available on the system.  1 is returned if the global
204     # criteria described in the previous paragraph are true, AND if all the
205     # specified categories are available on the platform and Configured to be
206     # used.  Otherwise 0 is returned.  The parameter is either a single POSIX
207     # locale category or a reference to a list of them.  Each category must be
208     # its name as a string, like 'LC_TIME' (the initial 'LC_' is optional), or
209     # the number this platform uses to signify the category (e.g.,
210     # 'locales_enabled(&POSIX::LC_CTYPE)'
211     #
212     # When the function returns 1 and a parameter was specified as a list
213     # reference, the reference will be altered on return to point to an
214     # equivalent list such that  the categories are numeric instead of strings
215     # and sorted to meet the input expectations of _trylocale().
216     #
217     # It is a fatal error to call this with something that isn't a known
218     # category to this file.  If this happens, look first for a typo, and
219     # second if you are using a category unknown to Perl.  In the latter case
220     # a bug report should be submitted.
221
222     # khw cargo-culted the '?' in the pattern on the next line.
223     return 0 if $Config{ccflags} =~ /\bD?NO_LOCALE\b/;
224
225     # If we can't load the POSIX XS module, we can't have locales even if they
226     # normally would be available
227     return 0 if ! defined &DynaLoader::boot_DynaLoader;
228
229     # Don't test locales where they aren't safe.  On systems with unsafe
230     # threads, for the purposes of testing, we consider the main thread safe,
231     # and all other threads unsafe.
232     if (! ${^SAFE_LOCALES}) {
233         require threads;
234         return 0 if threads->tid() != 0;
235     }
236
237     # If no setlocale, we need the POSIX 2008 alternatives
238     if (! $Config{d_setlocale}) {
239         return 0 if $Config{ccflags} =~ /\bD?NO_POSIX_2008_LOCALE\b/;
240         return 0 unless $Config{d_newlocale};
241         return 0 unless $Config{d_uselocale};
242         return 0 unless $Config{d_duplocale};
243         return 0 unless $Config{d_freelocale};
244     }
245
246     # Done with the global possibilities.  Now check if any passed in category
247     # is disabled.
248
249     my $categories_ref = $_[0];
250     my $return_categories_numbers = 0;
251     my @categories_numbers;
252     my $has_LC_ALL = 0;
253     my $has_LC_COLLATE = 0;
254
255     if (defined $categories_ref) {
256         my @local_categories_copy;
257
258         my $reftype = ref $categories_ref;
259         if ($reftype eq 'ARRAY') {
260             @local_categories_copy = @$categories_ref;
261             $return_categories_numbers = 1;
262         }
263         elsif ($reftype ne "") {
264             die "Parameter to locales_enabled() must be an ARRAY;"
265               . " instead you used a $reftype";
266         }
267         else {  # Single category passed in
268             @local_categories_copy = $categories_ref;
269         }
270
271         for my $category_name_or_number (@local_categories_copy) {
272             my $name;
273             my $number;
274             if ($category_name_or_number =~ / ^ -? \d+ $ /x) {
275                 $number = $category_name_or_number;
276                 die "Invalid locale category number '$number'"
277                     unless grep { $number == $_ } keys %category_name;
278                 $name = $category_name{$number};
279             }
280             else {
281                 $name = $category_name_or_number;
282                 $name =~ s/ ^ LC_ //x;
283                 foreach my $trial (keys %category_name) {
284                     if ($category_name{$trial} eq $name) {
285                         $number = $trial;
286                         last;
287                     }
288                 }
289                 die "Invalid locale category name '$name'"
290                     unless defined $number;
291             }
292
293             return 0 if    $number <= $max_bad_category_number
294                         || $Config{ccflags} =~ /\bD?NO_LOCALE_$name\b/;
295
296             eval "defined &POSIX::LC_$name";
297             return 0 if $@;
298
299             if ($return_categories_numbers) {
300                 if ($name eq 'CTYPE') {
301                     unshift @categories_numbers, $number;   # Always first
302                 }
303                 elsif ($name eq 'ALL') {
304                     $has_LC_ALL = 1;
305                 }
306                 elsif ($name eq 'COLLATE') {
307                     $has_LC_COLLATE = 1;
308                 }
309                 else {
310                     push @categories_numbers, $number;
311                 }
312             }
313         }
314     }
315
316     if ($return_categories_numbers) {
317
318         # COLLATE comes after all other locales except ALL, which comes last
319         if ($has_LC_COLLATE) {
320             push @categories_numbers, $category_number{'COLLATE'};
321         }
322         if ($has_LC_ALL) {
323             push @categories_numbers, $category_number{'ALL'};
324         }
325         $_[0]->@* = @categories_numbers;
326     }
327
328     return 1;
329 }
330
331
332 sub find_locales ($;$) {
333
334     # Returns an array of all the locales we found on the system.  If the
335     # optional 2nd parameter is non-zero, the list includes all found locales;
336     # otherwise it is restricted to those locales that play well with Perl, as
337     # far as we can easily determine.
338     #
339     # The first parameter is either a single locale category or a reference to
340     # a list of categories to find valid locales for it (or in the case of
341     # multiple) for all of them.  Each category can be a name (like 'LC_ALL'
342     # or simply 'ALL') or the C enum value for the category.
343
344     my $input_categories = shift;
345     my $allow_incompatible = shift // 0;
346
347     my @categories = (ref $input_categories) ? $input_categories->@* : $input_categories;
348     return unless locales_enabled(\@categories);
349
350     # Note, the subroutine call above converts the $categories into a form
351     # suitable for _trylocale().
352
353     # Visual C's CRT goes silly on strings of the form "en_US.ISO8859-1"
354     # and mingw32 uses said silly CRT
355     # This doesn't seem to be an issue any more, at least on Windows XP,
356     # so re-enable the tests for Windows XP onwards.
357     my $winxp = ($^O eq 'MSWin32' && defined &Win32::GetOSVersion &&
358                     join('.', (Win32::GetOSVersion())[1..2]) >= 5.1);
359     return if ((($^O eq 'MSWin32' && !$winxp) || $^O eq 'NetWare')
360                 && $Config{cc} =~ /^(cl|gcc|g\+\+|ici)/i);
361
362     # UWIN seems to loop after taint tests, just skip for now
363     return if ($^O =~ /^uwin/);
364
365     my @Locale;
366     _trylocale("C", \@categories, \@Locale, $allow_incompatible);
367     _trylocale("POSIX", \@categories, \@Locale, $allow_incompatible);
368
369     if ($Config{d_has_C_UTF8} && $Config{d_has_C_UTF8} eq 'true') {
370         _trylocale("C.UTF-8", \@categories, \@Locale, $allow_incompatible);
371     }
372
373     # There's no point in looking at anything more if we know that setlocale
374     # will return success on any garbage or non-garbage name.
375     return sort @Locale if defined $Config{d_setlocale_accepts_any_locale_name};
376
377     foreach (1..16) {
378         _trylocale("ISO8859-$_", \@categories, \@Locale, $allow_incompatible);
379         _trylocale("iso8859$_", \@categories, \@Locale, $allow_incompatible);
380         _trylocale("iso8859-$_", \@categories, \@Locale, $allow_incompatible);
381         _trylocale("iso_8859_$_", \@categories, \@Locale, $allow_incompatible);
382         _trylocale("isolatin$_", \@categories, \@Locale, $allow_incompatible);
383         _trylocale("isolatin-$_", \@categories, \@Locale, $allow_incompatible);
384         _trylocale("iso_latin_$_", \@categories, \@Locale, $allow_incompatible);
385     }
386
387     # Sanitize the environment so that we can run the external 'locale'
388     # program without the taint mode getting grumpy.
389
390     # $ENV{PATH} is special in VMS.
391     delete local $ENV{PATH} if $^O ne 'VMS' or $Config{d_setenv};
392
393     # Other subversive stuff.
394     delete local @ENV{qw(IFS CDPATH ENV BASH_ENV)};
395
396     if (-x "/usr/bin/locale"
397         && open(LOCALES, '-|', "/usr/bin/locale -a 2>/dev/null"))
398     {
399         while (<LOCALES>) {
400             # It seems that /usr/bin/locale steadfastly outputs 8 bit data, which
401             # ain't great when we're running this testPERL_UNICODE= so that utf8
402             # locales will cause all IO hadles to default to (assume) utf8
403             next unless utf8::valid($_);
404             chomp;
405             _trylocale($_, \@categories, \@Locale, $allow_incompatible);
406         }
407         close(LOCALES);
408     } elsif ($^O eq 'VMS'
409              && defined($ENV{'SYS$I18N_LOCALE'})
410              && -d 'SYS$I18N_LOCALE')
411     {
412     # The SYS$I18N_LOCALE logical name search list was not present on
413     # VAX VMS V5.5-12, but was on AXP && VAX VMS V6.2 as well as later versions.
414         opendir(LOCALES, "SYS\$I18N_LOCALE:");
415         while ($_ = readdir(LOCALES)) {
416             chomp;
417             _trylocale($_, \@categories, \@Locale, $allow_incompatible);
418         }
419         close(LOCALES);
420     } elsif (($^O eq 'openbsd' || $^O eq 'bitrig' ) && -e '/usr/share/locale') {
421
422         # OpenBSD doesn't have a locale executable, so reading
423         # /usr/share/locale is much easier and faster than the last resort
424         # method.
425
426         opendir(LOCALES, '/usr/share/locale');
427         while ($_ = readdir(LOCALES)) {
428             chomp;
429             _trylocale($_, \@categories, \@Locale, $allow_incompatible);
430         }
431         close(LOCALES);
432     } else { # Final fallback.  Try our list of locales hard-coded here
433
434         # This is going to be slow.
435         my @Data;
436
437         # Locales whose name differs if the utf8 bit is on are stored in these
438         # two files with appropriate encodings.
439         my $data_file = ($^H & 0x08 || (${^OPEN} || "") =~ /:utf8/)
440                         ? _source_location() . "/lib/locale/utf8"
441                         : _source_location() . "/lib/locale/latin1";
442         if (-e $data_file) {
443             @Data = do $data_file;
444         }
445         else {
446             _my_diag(__FILE__ . ":" . __LINE__ . ": '$data_file' doesn't exist");
447         }
448
449         # The rest of the locales are in this file.
450         state @my_data = <DATA>; close DATA if fileno DATA;
451         push @Data, @my_data;
452
453         foreach my $line (@Data) {
454             chomp $line;
455             my ($locale_name, $language_codes, $country_codes, $encodings) =
456                 split /:/, $line;
457             _my_diag(__FILE__ . ":" . __LINE__ . ": Unexpected syntax in '$line'")
458                                                      unless defined $locale_name;
459             my @enc = _decode_encodings($encodings);
460             foreach my $loc (split(/ /, $locale_name)) {
461                 _trylocale($loc, \@categories, \@Locale, $allow_incompatible);
462                 foreach my $enc (@enc) {
463                     _trylocale("$loc.$enc", \@categories, \@Locale,
464                                                             $allow_incompatible);
465                 }
466                 $loc = lc $loc;
467                 foreach my $enc (@enc) {
468                     _trylocale("$loc.$enc", \@categories, \@Locale,
469                                                             $allow_incompatible);
470                 }
471             }
472             foreach my $lang (split(/ /, $language_codes)) {
473                 _trylocale($lang, \@categories, \@Locale, $allow_incompatible);
474                 foreach my $country (split(/ /, $country_codes)) {
475                     my $lc = "${lang}_${country}";
476                     _trylocale($lc, \@categories, \@Locale, $allow_incompatible);
477                     foreach my $enc (@enc) {
478                         _trylocale("$lc.$enc", \@categories, \@Locale,
479                                                             $allow_incompatible);
480                     }
481                     my $lC = "${lang}_\U${country}";
482                     _trylocale($lC, \@categories, \@Locale, $allow_incompatible);
483                     foreach my $enc (@enc) {
484                         _trylocale("$lC.$enc", \@categories, \@Locale,
485                                                             $allow_incompatible);
486                     }
487                 }
488             }
489         }
490     }
491
492     @Locale = sort @Locale;
493
494     return @Locale;
495 }
496
497 sub is_locale_utf8 ($) { # Return a boolean as to if core Perl thinks the input
498                          # is a UTF-8 locale
499
500     # On z/OS, even locales marked as UTF-8 aren't.
501     return 0 if ord "A" != 65;
502
503     return 0 unless locales_enabled('LC_CTYPE');
504
505     my $locale = shift;
506
507     use locale;
508     no warnings 'locale'; # We may be trying out a weird locale
509
510     my $save_locale = setlocale(&POSIX::LC_CTYPE());
511     if (! $save_locale) {
512         ok(0, "Verify could save previous locale");
513         return 0;
514     }
515
516     if (! setlocale(&POSIX::LC_CTYPE(), $locale)) {
517         ok(0, "Verify could setlocale to $locale");
518         return 0;
519     }
520
521     my $ret = 0;
522
523     # Use an op that gives different results for UTF-8 than any other locale.
524     # If a platform has UTF-8 locales, there should be at least one locale on
525     # most platforms with UTF-8 in its name, so if there is a bug in the op
526     # giving a false negative, we should get a failure for those locales as we
527     # go through testing all the locales on the platform.
528     if (CORE::fc(chr utf8::unicode_to_native(0xdf)) ne "ss") {
529         if ($locale =~ /UTF-?8/i) {
530             ok (0, "Verify $locale with UTF-8 in name is a UTF-8 locale");
531         }
532     }
533     else {
534         $ret = 1;
535     }
536
537     die "Couldn't restore locale '$save_locale'"
538         unless setlocale(&POSIX::LC_CTYPE(), $save_locale);
539
540     return $ret;
541 }
542
543 sub find_utf8_ctype_locales (;$) { # Return the names of the locales that core
544                                   # Perl thinks are UTF-8 LC_CTYPE locales.
545                                   # Optional parameter is a reference to a
546                                   # list of locales to try; if omitted, this
547                                   # tries all locales it can find on the
548                                   # platform
549     return unless locales_enabled('LC_CTYPE');
550
551     my $locales_ref = shift;
552     my @return;
553
554     if (! defined $locales_ref) {
555
556         my @locales = find_locales(&POSIX::LC_CTYPE());
557         $locales_ref = \@locales;
558     }
559
560     foreach my $locale (@$locales_ref) {
561         push @return, $locale if is_locale_utf8($locale);
562     }
563
564     return @return;
565 }
566
567
568 sub find_utf8_ctype_locale (;$) { # Return the name of a locale that core Perl
569                                   # thinks is a UTF-8 LC_CTYPE non-turkic
570                                   # locale.
571                                   # Optional parameter is a reference to a
572                                   # list of locales to try; if omitted, this
573                                   # tries all locales it can find on the
574                                   # platform
575     my $try_locales_ref = shift;
576
577     my @utf8_locales = find_utf8_ctype_locales($try_locales_ref);
578     my @turkic_locales = find_utf8_turkic_locales($try_locales_ref);
579
580     my %seen_turkic;
581
582     # Create undef elements in the hash for turkic locales
583     @seen_turkic{@turkic_locales} = ();
584
585     foreach my $locale (@utf8_locales) {
586         return $locale unless exists $seen_turkic{$locale};
587     }
588
589     return;
590 }
591
592 sub find_utf8_turkic_locales (;$) {
593
594     # Return the name of all the locales that core Perl thinks are UTF-8
595     # Turkic LC_CTYPE.  Optional parameter is a reference to a list of locales
596     # to try; if omitted, this tries all locales it can find on the platform
597
598     my @return;
599
600     return unless locales_enabled('LC_CTYPE');
601
602     my $save_locale = setlocale(&POSIX::LC_CTYPE());
603     foreach my $locale (find_utf8_ctype_locales(shift)) {
604         use locale;
605         setlocale(&POSIX::LC_CTYPE(), $locale);
606         push @return, $locale if uc('i') eq "\x{130}";
607     }
608     setlocale(&POSIX::LC_CTYPE(), $save_locale);
609
610     return @return;
611 }
612
613 sub find_utf8_turkic_locale (;$) {
614     my @turkics = find_utf8_turkic_locales(shift);
615
616     return unless @turkics;
617     return $turkics[0]
618 }
619
620
621 # returns full path to the directory containing the current source
622 # file, inspired by mauke's Dir::Self
623 sub _source_location {
624     require File::Spec;
625
626     my $caller_filename = (caller)[1];
627
628     my $loc = File::Spec->rel2abs(
629         File::Spec->catpath(
630             (File::Spec->splitpath($caller_filename))[0, 1], ''
631         )
632     );
633
634     return ($loc =~ /^(.*)$/)[0]; # untaint
635 }
636
637 1
638
639 # Format of data is: locale_name, language_codes, country_codes, encodings
640 __DATA__
641 Afrikaans:af:za:1 15
642 Arabic:ar:dz eg sa:6 arabic8
643 Brezhoneg Breton:br:fr:1 15
644 Bulgarski Bulgarian:bg:bg:5
645 Chinese:zh:cn tw:cn.EUC eucCN eucTW euc.CN euc.TW Big5 GB2312 tw.EUC
646 Hrvatski Croatian:hr:hr:2
647 Cymraeg Welsh:cy:cy:1 14 15
648 Czech:cs:cz:2
649 Dansk Danish:da:dk:1 15
650 Nederlands Dutch:nl:be nl:1 15
651 English American British:en:au ca gb ie nz us uk zw:1 15 cp850
652 Esperanto:eo:eo:3
653 Eesti Estonian:et:ee:4 6 13
654 Suomi Finnish:fi:fi:1 15
655 Flamish::fl:1 15
656 Deutsch German:de:at be ch de lu:1 15
657 Euskaraz Basque:eu:es fr:1 15
658 Galego Galician:gl:es:1 15
659 Ellada Greek:el:gr:7 g8
660 Frysk:fy:nl:1 15
661 Greenlandic:kl:gl:4 6
662 Hebrew:iw:il:8 hebrew8
663 Hungarian:hu:hu:2
664 Indonesian:id:id:1 15
665 Gaeilge Irish:ga:IE:1 14 15
666 Italiano Italian:it:ch it:1 15
667 Nihongo Japanese:ja:jp:euc eucJP jp.EUC sjis
668 Korean:ko:kr:
669 Latine Latin:la:va:1 15
670 Latvian:lv:lv:4 6 13
671 Lithuanian:lt:lt:4 6 13
672 Macedonian:mk:mk:1 15
673 Maltese:mt:mt:3
674 Moldovan:mo:mo:2
675 Norsk Norwegian:no no\@nynorsk nb nn:no:1 15
676 Occitan:oc:es:1 15
677 Polski Polish:pl:pl:2
678 Rumanian:ro:ro:2
679 Russki Russian:ru:ru su ua:5 koi8 koi8r KOI8-R koi8u cp1251 cp866
680 Serbski Serbian:sr:yu:5
681 Slovak:sk:sk:2
682 Slovene Slovenian:sl:si:2
683 Sqhip Albanian:sq:sq:1 15
684 Svenska Swedish:sv:fi se:1 15
685 Thai:th:th:11 tis620
686 Turkish:tr:tr:9 turkish8
687 Yiddish:yi::1 15