This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make Unicode constants under use utf8 work again
[perl5.git] / pod / perllocale.pod
CommitLineData
5f05dabc 1=head1 NAME
2
b0c42ed9 3perllocale - Perl locale handling (internationalization and localization)
5f05dabc 4
5=head1 DESCRIPTION
6
e199995e
KW
7Locales these days have been mostly been supplanted by Unicode, but Perl
8continues to support them. See L</Unicode and UTF-8> below.
9
5a964f20
TC
10Perl supports language-specific notions of data such as "is this
11a letter", "what is the uppercase equivalent of this letter", and
12"which of these letters comes first". These are important issues,
13especially for languages other than English--but also for English: it
14would be naE<iuml>ve to imagine that C<A-Za-z> defines all the "letters"
b4ffc3db
TC
15needed to write correct English. Perl is also aware that some character other
16than "." may be preferred as a decimal point, and that output date
5a964f20
TC
17representations may be language-specific. The process of making an
18application take account of its users' preferences in such matters is
19called B<internationalization> (often abbreviated as B<i18n>); telling
20such an application about a particular set of preferences is known as
21B<localization> (B<l10n>).
14280422
DD
22
23Perl can understand language-specific data via the standardized (ISO C,
24XPG4, POSIX 1.c) method called "the locale system". The locale system is
b0c42ed9 25controlled per application using one pragma, one function call, and
14280422
DD
26several environment variables.
27
28B<NOTE>: This feature is new in Perl 5.004, and does not apply unless an
5a964f20 29application specifically requests it--see L<Backward compatibility>.
e38874e2
DD
30The one exception is that write() now B<always> uses the current locale
31- see L<"NOTES">.
5f05dabc 32
33=head1 PREPARING TO USE LOCALES
34
5a964f20 35If Perl applications are to understand and present your data
14280422 36correctly according a locale of your choice, B<all> of the following
5f05dabc 37must be true:
38
39=over 4
40
41=item *
42
43B<Your operating system must support the locale system>. If it does,
14280422 44you should find that the setlocale() function is a documented part of
5f05dabc 45its C library.
46
47=item *
48
5a964f20 49B<Definitions for locales that you use must be installed>. You, or
14280422
DD
50your system administrator, must make sure that this is the case. The
51available locales, the location in which they are kept, and the manner
5a964f20
TC
52in which they are installed all vary from system to system. Some systems
53provide only a few, hard-wired locales and do not allow more to be
54added. Others allow you to add "canned" locales provided by the system
55supplier. Still others allow you or the system administrator to define
14280422 56and add arbitrary locales. (You may have to ask your supplier to
5a964f20 57provide canned locales that are not delivered with your operating
14280422 58system.) Read your system documentation for further illumination.
5f05dabc 59
60=item *
61
62B<Perl must believe that the locale system is supported>. If it does,
63C<perl -V:d_setlocale> will say that the value for C<d_setlocale> is
64C<define>.
65
66=back
67
68If you want a Perl application to process and present your data
69according to a particular locale, the application code should include
2ae324a7 70the S<C<use locale>> pragma (see L<The use locale pragma>) where
5f05dabc 71appropriate, and B<at least one> of the following must be true:
72
73=over 4
74
75=item *
76
14280422 77B<The locale-determining environment variables (see L<"ENVIRONMENT">)
5a964f20
TC
78must be correctly set up> at the time the application is started, either
79by yourself or by whoever set up your system account.
5f05dabc 80
81=item *
82
14280422
DD
83B<The application must set its own locale> using the method described in
84L<The setlocale function>.
5f05dabc 85
86=back
87
88=head1 USING LOCALES
89
90=head2 The use locale pragma
91
14280422
DD
92By default, Perl ignores the current locale. The S<C<use locale>>
93pragma tells Perl to use the current locale for some operations:
5f05dabc 94
95=over 4
96
97=item *
98
14280422
DD
99B<The comparison operators> (C<lt>, C<le>, C<cmp>, C<ge>, and C<gt>) and
100the POSIX string collation functions strcoll() and strxfrm() use
5a964f20
TC
101C<LC_COLLATE>. sort() is also affected if used without an
102explicit comparison function, because it uses C<cmp> by default.
14280422 103
5a964f20 104B<Note:> C<eq> and C<ne> are unaffected by locale: they always
de108802 105perform a char-by-char comparison of their scalar operands. What's
14280422
DD
106more, if C<cmp> finds that its operands are equal according to the
107collation sequence specified by the current locale, it goes on to
de108802
RGS
108perform a char-by-char comparison, and only returns I<0> (equal) if the
109operands are char-for-char identical. If you really want to know whether
5a964f20 110two strings--which C<eq> and C<cmp> may consider different--are equal
14280422
DD
111as far as collation in the locale is concerned, see the discussion in
112L<Category LC_COLLATE: Collation>.
5f05dabc 113
114=item *
115
14280422
DD
116B<Regular expressions and case-modification functions> (uc(), lc(),
117ucfirst(), and lcfirst()) use C<LC_CTYPE>
5f05dabc 118
119=item *
120
903eb63f 121B<Format declarations> (format()) use C<LC_NUMERIC>
5f05dabc 122
123=item *
124
14280422 125B<The POSIX date formatting function> (strftime()) uses C<LC_TIME>.
5f05dabc 126
127=back
128
13a2d996
SP
129C<LC_COLLATE>, C<LC_CTYPE>, and so on, are discussed further in
130L<LOCALE CATEGORIES>.
5f05dabc 131
5a964f20
TC
132The default behavior is restored with the S<C<no locale>> pragma, or
133upon reaching the end of block enclosing C<use locale>.
5f05dabc 134
5a964f20 135The string result of any operation that uses locale
14280422
DD
136information is tainted, as it is possible for a locale to be
137untrustworthy. See L<"SECURITY">.
5f05dabc 138
139=head2 The setlocale function
140
14280422
DD
141You can switch locales as often as you wish at run time with the
142POSIX::setlocale() function:
5f05dabc 143
144 # This functionality not usable prior to Perl 5.004
145 require 5.004;
146
147 # Import locale-handling tool set from POSIX module.
148 # This example uses: setlocale -- the function call
149 # LC_CTYPE -- explained below
150 use POSIX qw(locale_h);
151
14280422 152 # query and save the old locale
5f05dabc 153 $old_locale = setlocale(LC_CTYPE);
154
155 setlocale(LC_CTYPE, "fr_CA.ISO8859-1");
156 # LC_CTYPE now in locale "French, Canada, codeset ISO 8859-1"
157
158 setlocale(LC_CTYPE, "");
159 # LC_CTYPE now reset to default defined by LC_ALL/LC_CTYPE/LANG
160 # environment variables. See below for documentation.
161
162 # restore the old locale
163 setlocale(LC_CTYPE, $old_locale);
164
14280422
DD
165The first argument of setlocale() gives the B<category>, the second the
166B<locale>. The category tells in what aspect of data processing you
167want to apply locale-specific rules. Category names are discussed in
168L<LOCALE CATEGORIES> and L<"ENVIRONMENT">. The locale is the name of a
169collection of customization information corresponding to a particular
170combination of language, country or territory, and codeset. Read on for
171hints on the naming of locales: not all systems name locales as in the
172example.
173
502a173a
JH
174If no second argument is provided and the category is something else
175than LC_ALL, the function returns a string naming the current locale
176for the category. You can use this value as the second argument in a
177subsequent call to setlocale().
178
179If no second argument is provided and the category is LC_ALL, the
180result is implementation-dependent. It may be a string of
181concatenated locales names (separator also implementation-dependent)
f979aebc 182or a single locale name. Please consult your setlocale(3) man page for
502a173a
JH
183details.
184
185If a second argument is given and it corresponds to a valid locale,
186the locale for the category is set to that value, and the function
187returns the now-current locale value. You can then use this in yet
188another call to setlocale(). (In some implementations, the return
189value may sometimes differ from the value you gave as the second
190argument--think of it as an alias for the value you gave.)
5f05dabc 191
192As the example shows, if the second argument is an empty string, the
193category's locale is returned to the default specified by the
194corresponding environment variables. Generally, this results in a
5a964f20 195return to the default that was in force when Perl started up: changes
54310121 196to the environment made by the application after startup may or may not
5a964f20 197be noticed, depending on your system's C library.
5f05dabc 198
14280422
DD
199If the second argument does not correspond to a valid locale, the locale
200for the category is not changed, and the function returns I<undef>.
5f05dabc 201
f979aebc 202For further information about the categories, consult setlocale(3).
3e6e419a
JH
203
204=head2 Finding locales
205
f979aebc 206For locales available in your system, consult also setlocale(3) to
5a964f20
TC
207see whether it leads to the list of available locales (search for the
208I<SEE ALSO> section). If that fails, try the following command lines:
5f05dabc 209
210 locale -a
211
212 nlsinfo
213
214 ls /usr/lib/nls/loc
215
216 ls /usr/lib/locale
217
218 ls /usr/lib/nls
219
b478f28d
JH
220 ls /usr/share/locale
221
5f05dabc 222and see whether they list something resembling these
223
2bdf8add 224 en_US.ISO8859-1 de_DE.ISO8859-1 ru_RU.ISO8859-5
502a173a 225 en_US.iso88591 de_DE.iso88591 ru_RU.iso88595
2bdf8add 226 en_US de_DE ru_RU
14280422 227 en de ru
2bdf8add
JH
228 english german russian
229 english.iso88591 german.iso88591 russian.iso88595
502a173a 230 english.roman8 russian.koi8r
5f05dabc 231
528d65ad
JH
232Sadly, even though the calling interface for setlocale() has been
233standardized, names of locales and the directories where the
5a964f20 234configuration resides have not been. The basic form of the name is
528d65ad
JH
235I<language_territory>B<.>I<codeset>, but the latter parts after
236I<language> are not always present. The I<language> and I<country>
237are usually from the standards B<ISO 3166> and B<ISO 639>, the
238two-letter abbreviations for the countries and the languages of the
239world, respectively. The I<codeset> part often mentions some B<ISO
2408859> character set, the Latin codesets. For example, C<ISO 8859-1>
241is the so-called "Western European codeset" that can be used to encode
242most Western European languages adequately. Again, there are several
243ways to write even the name of that one standard. Lamentably.
5f05dabc 244
14280422
DD
245Two special locales are worth particular mention: "C" and "POSIX".
246Currently these are effectively the same locale: the difference is
5a964f20
TC
247mainly that the first one is defined by the C standard, the second by
248the POSIX standard. They define the B<default locale> in which
14280422 249every program starts in the absence of locale information in its
5a964f20 250environment. (The I<default> default locale, if you will.) Its language
14280422 251is (American) English and its character codeset ASCII.
5f05dabc 252
14280422
DD
253B<NOTE>: Not all systems have the "POSIX" locale (not all systems are
254POSIX-conformant), so use "C" when you need explicitly to specify this
255default locale.
5f05dabc 256
3e6e419a
JH
257=head2 LOCALE PROBLEMS
258
5a964f20 259You may encounter the following warning message at Perl startup:
3e6e419a
JH
260
261 perl: warning: Setting locale failed.
262 perl: warning: Please check that your locale settings:
263 LC_ALL = "En_US",
264 LANG = (unset)
265 are supported and installed on your system.
266 perl: warning: Falling back to the standard locale ("C").
267
5a964f20
TC
268This means that your locale settings had LC_ALL set to "En_US" and
269LANG exists but has no value. Perl tried to believe you but could not.
270Instead, Perl gave up and fell back to the "C" locale, the default locale
271that is supposed to work no matter what. This usually means your locale
272settings were wrong, they mention locales your system has never heard
273of, or the locale installation in your system has problems (for example,
274some system files are broken or missing). There are quick and temporary
275fixes to these problems, as well as more thorough and lasting fixes.
3e6e419a
JH
276
277=head2 Temporarily fixing locale problems
278
5a964f20 279The two quickest fixes are either to render Perl silent about any
3e6e419a
JH
280locale inconsistencies or to run Perl under the default locale "C".
281
282Perl's moaning about locale problems can be silenced by setting the
900bd440
JH
283environment variable PERL_BADLANG to a zero value, for example "0".
284This method really just sweeps the problem under the carpet: you tell
285Perl to shut up even when Perl sees that something is wrong. Do not
286be surprised if later something locale-dependent misbehaves.
3e6e419a
JH
287
288Perl can be run under the "C" locale by setting the environment
5a964f20
TC
289variable LC_ALL to "C". This method is perhaps a bit more civilized
290than the PERL_BADLANG approach, but setting LC_ALL (or
291other locale variables) may affect other programs as well, not just
292Perl. In particular, external programs run from within Perl will see
3e6e419a 293these changes. If you make the new settings permanent (read on), all
f979aebc 294programs you run see the changes. See L<"ENVIRONMENT"> for
5a964f20
TC
295the full list of relevant environment variables and L<USING LOCALES>
296for their effects in Perl. Effects in other programs are
297easily deducible. For example, the variable LC_COLLATE may well affect
b432a672 298your B<sort> program (or whatever the program that arranges "records"
3e6e419a
JH
299alphabetically in your system is called).
300
5a964f20
TC
301You can test out changing these variables temporarily, and if the
302new settings seem to help, put those settings into your shell startup
303files. Consult your local documentation for the exact details. For in
304Bourne-like shells (B<sh>, B<ksh>, B<bash>, B<zsh>):
3e6e419a
JH
305
306 LC_ALL=en_US.ISO8859-1
307 export LC_ALL
308
5a964f20
TC
309This assumes that we saw the locale "en_US.ISO8859-1" using the commands
310discussed above. We decided to try that instead of the above faulty
311locale "En_US"--and in Cshish shells (B<csh>, B<tcsh>)
3e6e419a
JH
312
313 setenv LC_ALL en_US.ISO8859-1
c47ff5f1 314
c406981e
JH
315or if you have the "env" application you can do in any shell
316
317 env LC_ALL=en_US.ISO8859-1 perl ...
318
5a964f20 319If you do not know what shell you have, consult your local
3e6e419a
JH
320helpdesk or the equivalent.
321
322=head2 Permanently fixing locale problems
323
5a964f20
TC
324The slower but superior fixes are when you may be able to yourself
325fix the misconfiguration of your own environment variables. The
3e6e419a
JH
326mis(sing)configuration of the whole system's locales usually requires
327the help of your friendly system administrator.
328
5a964f20
TC
329First, see earlier in this document about L<Finding locales>. That tells
330how to find which locales are really supported--and more importantly,
331installed--on your system. In our example error message, environment
332variables affecting the locale are listed in the order of decreasing
333importance (and unset variables do not matter). Therefore, having
334LC_ALL set to "En_US" must have been the bad choice, as shown by the
335error message. First try fixing locale settings listed first.
3e6e419a 336
5a964f20
TC
337Second, if using the listed commands you see something B<exactly>
338(prefix matches do not count and case usually counts) like "En_US"
339without the quotes, then you should be okay because you are using a
340locale name that should be installed and available in your system.
4a4eefd0 341In this case, see L<Permanently fixing your system's locale configuration>.
3e6e419a 342
4a4eefd0 343=head2 Permanently fixing your system's locale configuration
3e6e419a 344
5a964f20 345This is when you see something like:
3e6e419a
JH
346
347 perl: warning: Please check that your locale settings:
348 LC_ALL = "En_US",
349 LANG = (unset)
350 are supported and installed on your system.
351
352but then cannot see that "En_US" listed by the above-mentioned
5a964f20
TC
353commands. You may see things like "en_US.ISO8859-1", but that isn't
354the same. In this case, try running under a locale
355that you can list and which somehow matches what you tried. The
3e6e419a 356rules for matching locale names are a bit vague because
13a2d996
SP
357standardization is weak in this area. See again the
358L<Finding locales> about general rules.
3e6e419a 359
b687b08b 360=head2 Fixing system locale configuration
3e6e419a 361
5a964f20
TC
362Contact a system administrator (preferably your own) and report the exact
363error message you get, and ask them to read this same documentation you
364are now reading. They should be able to check whether there is something
365wrong with the locale configuration of the system. The L<Finding locales>
366section is unfortunately a bit vague about the exact commands and places
367because these things are not that standardized.
3e6e419a 368
5f05dabc 369=head2 The localeconv function
370
14280422
DD
371The POSIX::localeconv() function allows you to get particulars of the
372locale-dependent numeric formatting information specified by the current
373C<LC_NUMERIC> and C<LC_MONETARY> locales. (If you just want the name of
374the current locale for a particular category, use POSIX::setlocale()
5a964f20 375with a single parameter--see L<The setlocale function>.)
5f05dabc 376
377 use POSIX qw(locale_h);
5f05dabc 378
379 # Get a reference to a hash of locale-dependent info
380 $locale_values = localeconv();
381
382 # Output sorted list of the values
383 for (sort keys %$locale_values) {
14280422 384 printf "%-20s = %s\n", $_, $locale_values->{$_}
5f05dabc 385 }
386
14280422 387localeconv() takes no arguments, and returns B<a reference to> a hash.
5a964f20 388The keys of this hash are variable names for formatting, such as
502a173a 389C<decimal_point> and C<thousands_sep>. The values are the
cea6626f 390corresponding, er, values. See L<POSIX/localeconv> for a longer
502a173a
JH
391example listing the categories an implementation might be expected to
392provide; some provide more and others fewer. You don't need an
393explicit C<use locale>, because localeconv() always observes the
394current locale.
5f05dabc 395
5a964f20
TC
396Here's a simple-minded example program that rewrites its command-line
397parameters as integers correctly formatted in the current locale:
5f05dabc 398
399 # See comments in previous example
400 require 5.004;
401 use POSIX qw(locale_h);
5f05dabc 402
403 # Get some of locale's numeric formatting parameters
404 my ($thousands_sep, $grouping) =
14280422 405 @{localeconv()}{'thousands_sep', 'grouping'};
5f05dabc 406
407 # Apply defaults if values are missing
408 $thousands_sep = ',' unless $thousands_sep;
502a173a
JH
409
410 # grouping and mon_grouping are packed lists
411 # of small integers (characters) telling the
412 # grouping (thousand_seps and mon_thousand_seps
413 # being the group dividers) of numbers and
414 # monetary quantities. The integers' meanings:
415 # 255 means no more grouping, 0 means repeat
416 # the previous grouping, 1-254 means use that
417 # as the current grouping. Grouping goes from
418 # right to left (low to high digits). In the
419 # below we cheat slightly by never using anything
420 # else than the first grouping (whatever that is).
421 if ($grouping) {
422 @grouping = unpack("C*", $grouping);
423 } else {
424 @grouping = (3);
425 }
5f05dabc 426
427 # Format command line params for current locale
14280422
DD
428 for (@ARGV) {
429 $_ = int; # Chop non-integer part
5f05dabc 430 1 while
502a173a 431 s/(\d)(\d{$grouping[0]}($|$thousands_sep))/$1$thousands_sep$2/;
14280422 432 print "$_";
5f05dabc 433 }
434 print "\n";
435
74c76037 436=head2 I18N::Langinfo
4bbcc6e8
JH
437
438Another interface for querying locale-dependent information is the
e1020413 439I18N::Langinfo::langinfo() function, available at least in Unix-like
4bbcc6e8
JH
440systems and VMS.
441
74c76037
JH
442The following example will import the langinfo() function itself and
443three constants to be used as arguments to langinfo(): a constant for
444the abbreviated first day of the week (the numbering starts from
445Sunday = 1) and two more constants for the affirmative and negative
446answers for a yes/no question in the current locale.
4bbcc6e8 447
74c76037 448 use I18N::Langinfo qw(langinfo ABDAY_1 YESSTR NOSTR);
4bbcc6e8 449
74c76037 450 my ($abday_1, $yesstr, $nostr) = map { langinfo } qw(ABDAY_1 YESSTR NOSTR);
4bbcc6e8 451
74c76037 452 print "$abday_1? [$yesstr/$nostr] ";
4bbcc6e8 453
74c76037
JH
454In other words, in the "C" (or English) locale the above will probably
455print something like:
456
457 Sun? [yes/no]
4bbcc6e8
JH
458
459See L<I18N::Langinfo> for more information.
460
5f05dabc 461=head1 LOCALE CATEGORIES
462
5a964f20
TC
463The following subsections describe basic locale categories. Beyond these,
464some combination categories allow manipulation of more than one
465basic category at a time. See L<"ENVIRONMENT"> for a discussion of these.
5f05dabc 466
467=head2 Category LC_COLLATE: Collation
468
5a964f20
TC
469In the scope of S<C<use locale>>, Perl looks to the C<LC_COLLATE>
470environment variable to determine the application's notions on collation
b4ffc3db
TC
471(ordering) of characters. For example, "b" follows "a" in Latin
472alphabets, but where do "E<aacute>" and "E<aring>" belong? And while
473"color" follows "chocolate" in English, what about in Spanish?
5f05dabc 474
60f0fa02
JH
475The following collations all make sense and you may meet any of them
476if you "use locale".
477
478 A B C D E a b c d e
35316ca3 479 A a B b C c D d E e
60f0fa02
JH
480 a A b B c C d D e E
481 a b c d e A B C D E
482
f1cbbd6e 483Here is a code snippet to tell what "word"
5a964f20 484characters are in the current locale, in that locale's order:
5f05dabc 485
486 use locale;
35316ca3 487 print +(sort grep /\w/, map { chr } 0..255), "\n";
5f05dabc 488
14280422
DD
489Compare this with the characters that you see and their order if you
490state explicitly that the locale should be ignored:
5f05dabc 491
492 no locale;
35316ca3 493 print +(sort grep /\w/, map { chr } 0..255), "\n";
5f05dabc 494
495This machine-native collation (which is what you get unless S<C<use
496locale>> has appeared earlier in the same block) must be used for
497sorting raw binary data, whereas the locale-dependent collation of the
b0c42ed9 498first example is useful for natural text.
5f05dabc 499
14280422
DD
500As noted in L<USING LOCALES>, C<cmp> compares according to the current
501collation locale when C<use locale> is in effect, but falls back to a
de108802 502char-by-char comparison for strings that the locale says are equal. You
14280422
DD
503can use POSIX::strcoll() if you don't want this fall-back:
504
505 use POSIX qw(strcoll);
506 $equal_in_locale =
507 !strcoll("space and case ignored", "SpaceAndCaseIgnored");
508
509$equal_in_locale will be true if the collation locale specifies a
5a964f20 510dictionary-like ordering that ignores space characters completely and
9e3a2af8 511which folds case.
14280422 512
5a964f20 513If you have a single string that you want to check for "equality in
14280422
DD
514locale" against several others, you might think you could gain a little
515efficiency by using POSIX::strxfrm() in conjunction with C<eq>:
516
517 use POSIX qw(strxfrm);
518 $xfrm_string = strxfrm("Mixed-case string");
519 print "locale collation ignores spaces\n"
520 if $xfrm_string eq strxfrm("Mixed-casestring");
521 print "locale collation ignores hyphens\n"
522 if $xfrm_string eq strxfrm("Mixedcase string");
523 print "locale collation ignores case\n"
524 if $xfrm_string eq strxfrm("mixed-case string");
525
526strxfrm() takes a string and maps it into a transformed string for use
de108802 527in char-by-char comparisons against other transformed strings during
14280422 528collation. "Under the hood", locale-affected Perl comparison operators
de108802 529call strxfrm() for both operands, then do a char-by-char
5a964f20 530comparison of the transformed strings. By calling strxfrm() explicitly
14280422 531and using a non locale-affected comparison, the example attempts to save
5a964f20 532a couple of transformations. But in fact, it doesn't save anything: Perl
2ae324a7 533magic (see L<perlguts/Magic Variables>) creates the transformed version of a
5a964f20 534string the first time it's needed in a comparison, then keeps this version around
14280422 535in case it's needed again. An example rewritten the easy way with
e38874e2 536C<cmp> runs just about as fast. It also copes with null characters
14280422 537embedded in strings; if you call strxfrm() directly, it treats the first
5a964f20
TC
538null it finds as a terminator. don't expect the transformed strings
539it produces to be portable across systems--or even from one revision
e38874e2
DD
540of your operating system to the next. In short, don't call strxfrm()
541directly: let Perl do it for you.
14280422 542
5a964f20 543Note: C<use locale> isn't shown in some of these examples because it isn't
14280422
DD
544needed: strcoll() and strxfrm() exist only to generate locale-dependent
545results, and so always obey the current C<LC_COLLATE> locale.
5f05dabc 546
547=head2 Category LC_CTYPE: Character Types
548
5a964f20 549In the scope of S<C<use locale>>, Perl obeys the C<LC_CTYPE> locale
14280422
DD
550setting. This controls the application's notion of which characters are
551alphabetic. This affects Perl's C<\w> regular expression metanotation,
f1cbbd6e
GS
552which stands for alphanumeric characters--that is, alphabetic,
553numeric, and including other special characters such as the underscore or
554hyphen. (Consult L<perlre> for more information about
14280422 555regular expressions.) Thanks to C<LC_CTYPE>, depending on your locale
b4ffc3db
TC
556setting, characters like "E<aelig>", "E<eth>", "E<szlig>", and
557"E<oslash>" may be understood as C<\w> characters.
5f05dabc 558
2c268ad5 559The C<LC_CTYPE> locale also provides the map used in transliterating
68dc0745 560characters between lower and uppercase. This affects the case-mapping
5a964f20
TC
561functions--lc(), lcfirst, uc(), and ucfirst(); case-mapping
562interpolation with C<\l>, C<\L>, C<\u>, or C<\U> in double-quoted strings
563and C<s///> substitutions; and case-independent regular expression
e38874e2
DD
564pattern matching using the C<i> modifier.
565
5a964f20
TC
566Finally, C<LC_CTYPE> affects the POSIX character-class test
567functions--isalpha(), islower(), and so on. For example, if you move
568from the "C" locale to a 7-bit Scandinavian one, you may find--possibly
569to your surprise--that "|" moves from the ispunct() class to isalpha().
5f05dabc 570
14280422
DD
571B<Note:> A broken or malicious C<LC_CTYPE> locale definition may result
572in clearly ineligible characters being considered to be alphanumeric by
e199995e 573your application. For strict matching of (mundane) ASCII letters and
5a964f20 574digits--for example, in command strings--locale-aware applications
e199995e 575should use C<\w> with the C</a> regular expression modifier. See L<"SECURITY">.
5f05dabc 576
577=head2 Category LC_NUMERIC: Numeric Formatting
578
2095dafa
RGS
579After a proper POSIX::setlocale() call, Perl obeys the C<LC_NUMERIC>
580locale information, which controls an application's idea of how numbers
581should be formatted for human readability by the printf(), sprintf(), and
582write() functions. String-to-numeric conversion by the POSIX::strtod()
5a964f20 583function is also affected. In most implementations the only effect is to
b4ffc3db 584change the character used for the decimal point--perhaps from "." to ",".
5a964f20 585These functions aren't aware of such niceties as thousands separation and
2095dafa 586so on. (See L<The localeconv function> if you care about these things.)
5a964f20 587
3cf03d68 588Output produced by print() is also affected by the current locale: it
3cf03d68
JH
589corresponds to what you'd get from printf() in the "C" locale. The
590same is true for Perl's internal conversions between numeric and
591string formats:
5f05dabc 592
2095dafa
RGS
593 use POSIX qw(strtod setlocale LC_NUMERIC);
594
595 setlocale LC_NUMERIC, "";
14280422 596
5f05dabc 597 $n = 5/2; # Assign numeric 2.5 to $n
598
35316ca3 599 $a = " $n"; # Locale-dependent conversion to string
5f05dabc 600
35316ca3 601 print "half five is $n\n"; # Locale-dependent output
5f05dabc 602
603 printf "half five is %g\n", $n; # Locale-dependent output
604
14280422
DD
605 print "DECIMAL POINT IS COMMA\n"
606 if $n == (strtod("2,5"))[0]; # Locale-dependent conversion
5f05dabc 607
4bbcc6e8
JH
608See also L<I18N::Langinfo> and C<RADIXCHAR>.
609
5f05dabc 610=head2 Category LC_MONETARY: Formatting of monetary amounts
611
e199995e 612The C standard defines the C<LC_MONETARY> category, but not a function
5a964f20 613that is affected by its contents. (Those with experience of standards
b0c42ed9 614committees will recognize that the working group decided to punt on the
14280422 615issue.) Consequently, Perl takes no notice of it. If you really want
13a2d996
SP
616to use C<LC_MONETARY>, you can query its contents--see
617L<The localeconv function>--and use the information that it returns in your
618application's own formatting of currency amounts. However, you may well
619find that the information, voluminous and complex though it may be, still
620does not quite meet your requirements: currency formatting is a hard nut
621to crack.
5f05dabc 622
4bbcc6e8
JH
623See also L<I18N::Langinfo> and C<CRNCYSTR>.
624
5f05dabc 625=head2 LC_TIME
626
5a964f20 627Output produced by POSIX::strftime(), which builds a formatted
5f05dabc 628human-readable date/time string, is affected by the current C<LC_TIME>
629locale. Thus, in a French locale, the output produced by the C<%B>
630format element (full month name) for the first month of the year would
5a964f20 631be "janvier". Here's how to get a list of long month names in the
5f05dabc 632current locale:
633
634 use POSIX qw(strftime);
14280422
DD
635 for (0..11) {
636 $long_month_name[$_] =
637 strftime("%B", 0, 0, 0, 1, $_, 96);
5f05dabc 638 }
639
5a964f20 640Note: C<use locale> isn't needed in this example: as a function that
14280422
DD
641exists only to generate locale-dependent results, strftime() always
642obeys the current C<LC_TIME> locale.
5f05dabc 643
4bbcc6e8 644See also L<I18N::Langinfo> and C<ABDAY_1>..C<ABDAY_7>, C<DAY_1>..C<DAY_7>,
2a2bf5f4 645C<ABMON_1>..C<ABMON_12>, and C<ABMON_1>..C<ABMON_12>.
4bbcc6e8 646
5f05dabc 647=head2 Other categories
648
5a964f20
TC
649The remaining locale category, C<LC_MESSAGES> (possibly supplemented
650by others in particular implementations) is not currently used by
98a6f11e 651Perl--except possibly to affect the behavior of library functions
652called by extensions outside the standard Perl distribution and by the
653operating system and its utilities. Note especially that the string
654value of C<$!> and the error messages given by external utilities may
655be changed by C<LC_MESSAGES>. If you want to have portable error
265f5c4a 656codes, use C<%!>. See L<Errno>.
14280422
DD
657
658=head1 SECURITY
659
5a964f20 660Although the main discussion of Perl security issues can be found in
14280422
DD
661L<perlsec>, a discussion of Perl's locale handling would be incomplete
662if it did not draw your attention to locale-dependent security issues.
5a964f20
TC
663Locales--particularly on systems that allow unprivileged users to
664build their own locales--are untrustworthy. A malicious (or just plain
14280422
DD
665broken) locale can make a locale-aware application give unexpected
666results. Here are a few possibilities:
667
668=over 4
669
670=item *
671
672Regular expression checks for safe file names or mail addresses using
5a964f20 673C<\w> may be spoofed by an C<LC_CTYPE> locale that claims that
14280422
DD
674characters such as "E<gt>" and "|" are alphanumeric.
675
676=item *
677
e38874e2
DD
678String interpolation with case-mapping, as in, say, C<$dest =
679"C:\U$name.$ext">, may produce dangerous results if a bogus LC_CTYPE
680case-mapping table is in effect.
681
682=item *
683
14280422
DD
684A sneaky C<LC_COLLATE> locale could result in the names of students with
685"D" grades appearing ahead of those with "A"s.
686
687=item *
688
5a964f20 689An application that takes the trouble to use information in
14280422 690C<LC_MONETARY> may format debits as if they were credits and vice versa
5a964f20 691if that locale has been subverted. Or it might make payments in US
14280422
DD
692dollars instead of Hong Kong dollars.
693
694=item *
695
696The date and day names in dates formatted by strftime() could be
697manipulated to advantage by a malicious user able to subvert the
5a964f20 698C<LC_DATE> locale. ("Look--it says I wasn't in the building on
14280422
DD
699Sunday.")
700
701=back
702
703Such dangers are not peculiar to the locale system: any aspect of an
5a964f20 704application's environment which may be modified maliciously presents
14280422 705similar challenges. Similarly, they are not specific to Perl: any
5a964f20 706programming language that allows you to write programs that take
14280422
DD
707account of their environment exposes you to these issues.
708
5a964f20
TC
709Perl cannot protect you from all possibilities shown in the
710examples--there is no substitute for your own vigilance--but, when
14280422 711C<use locale> is in effect, Perl uses the tainting mechanism (see
5a964f20 712L<perlsec>) to mark string results that become locale-dependent, and
14280422 713which may be untrustworthy in consequence. Here is a summary of the
5a964f20 714tainting behavior of operators and functions that may be affected by
14280422
DD
715the locale:
716
717=over 4
718
551e1d92
RB
719=item *
720
721B<Comparison operators> (C<lt>, C<le>, C<ge>, C<gt> and C<cmp>):
14280422
DD
722
723Scalar true/false (or less/equal/greater) result is never tainted.
724
551e1d92
RB
725=item *
726
727B<Case-mapping interpolation> (with C<\l>, C<\L>, C<\u> or C<\U>)
e38874e2
DD
728
729Result string containing interpolated material is tainted if
730C<use locale> is in effect.
731
551e1d92
RB
732=item *
733
734B<Matching operator> (C<m//>):
14280422
DD
735
736Scalar true/false result never tainted.
737
5a964f20 738Subpatterns, either delivered as a list-context result or as $1 etc.
14280422 739are tainted if C<use locale> is in effect, and the subpattern regular
e38874e2 740expression contains C<\w> (to match an alphanumeric character), C<\W>
6b0ac556
OK
741(non-alphanumeric character), C<\s> (whitespace character), or C<\S>
742(non whitespace character). The matched-pattern variable, $&, $`
e38874e2
DD
743(pre-match), $' (post-match), and $+ (last match) are also tainted if
744C<use locale> is in effect and the regular expression contains C<\w>,
745C<\W>, C<\s>, or C<\S>.
14280422 746
551e1d92
RB
747=item *
748
749B<Substitution operator> (C<s///>):
14280422 750
e38874e2 751Has the same behavior as the match operator. Also, the left
5a964f20
TC
752operand of C<=~> becomes tainted when C<use locale> in effect
753if modified as a result of a substitution based on a regular
e38874e2 754expression match involving C<\w>, C<\W>, C<\s>, or C<\S>; or of
7b8d334a 755case-mapping with C<\l>, C<\L>,C<\u> or C<\U>.
14280422 756
551e1d92
RB
757=item *
758
759B<Output formatting functions> (printf() and write()):
14280422 760
3cf03d68
JH
761Results are never tainted because otherwise even output from print,
762for example C<print(1/7)>, should be tainted if C<use locale> is in
763effect.
14280422 764
551e1d92
RB
765=item *
766
767B<Case-mapping functions> (lc(), lcfirst(), uc(), ucfirst()):
14280422
DD
768
769Results are tainted if C<use locale> is in effect.
770
551e1d92
RB
771=item *
772
773B<POSIX locale-dependent functions> (localeconv(), strcoll(),
14280422
DD
774strftime(), strxfrm()):
775
776Results are never tainted.
777
551e1d92
RB
778=item *
779
780B<POSIX character class tests> (isalnum(), isalpha(), isdigit(),
14280422
DD
781isgraph(), islower(), isprint(), ispunct(), isspace(), isupper(),
782isxdigit()):
783
784True/false results are never tainted.
785
786=back
787
788Three examples illustrate locale-dependent tainting.
789The first program, which ignores its locale, won't run: a value taken
54310121 790directly from the command line may not be used to name an output file
14280422
DD
791when taint checks are enabled.
792
793 #/usr/local/bin/perl -T
794 # Run with taint checking
795
54310121 796 # Command line sanity check omitted...
14280422
DD
797 $tainted_output_file = shift;
798
799 open(F, ">$tainted_output_file")
800 or warn "Open of $untainted_output_file failed: $!\n";
801
802The program can be made to run by "laundering" the tainted value through
5a964f20
TC
803a regular expression: the second example--which still ignores locale
804information--runs, creating the file named on its command line
14280422
DD
805if it can.
806
807 #/usr/local/bin/perl -T
808
809 $tainted_output_file = shift;
810 $tainted_output_file =~ m%[\w/]+%;
811 $untainted_output_file = $&;
812
813 open(F, ">$untainted_output_file")
814 or warn "Open of $untainted_output_file failed: $!\n";
815
5a964f20 816Compare this with a similar but locale-aware program:
14280422
DD
817
818 #/usr/local/bin/perl -T
819
820 $tainted_output_file = shift;
821 use locale;
822 $tainted_output_file =~ m%[\w/]+%;
823 $localized_output_file = $&;
824
825 open(F, ">$localized_output_file")
826 or warn "Open of $localized_output_file failed: $!\n";
827
828This third program fails to run because $& is tainted: it is the result
5a964f20 829of a match involving C<\w> while C<use locale> is in effect.
5f05dabc 830
831=head1 ENVIRONMENT
832
833=over 12
834
835=item PERL_BADLANG
836
14280422 837A string that can suppress Perl's warning about failed locale settings
54310121 838at startup. Failure can occur if the locale support in the operating
5a964f20 839system is lacking (broken) in some way--or if you mistyped the name of
900bd440
JH
840a locale when you set up your environment. If this environment
841variable is absent, or has a value that does not evaluate to integer
842zero--that is, "0" or ""-- Perl will complain about locale setting
843failures.
5f05dabc 844
14280422
DD
845B<NOTE>: PERL_BADLANG only gives you a way to hide the warning message.
846The message tells about some problem in your system's locale support,
847and you should investigate what the problem is.
5f05dabc 848
849=back
850
851The following environment variables are not specific to Perl: They are
14280422
DD
852part of the standardized (ISO C, XPG4, POSIX 1.c) setlocale() method
853for controlling an application's opinion on data.
5f05dabc 854
855=over 12
856
857=item LC_ALL
858
5a964f20 859C<LC_ALL> is the "override-all" locale environment variable. If
5f05dabc 860set, it overrides all the rest of the locale environment variables.
861
528d65ad
JH
862=item LANGUAGE
863
864B<NOTE>: C<LANGUAGE> is a GNU extension, it affects you only if you
865are using the GNU libc. This is the case if you are using e.g. Linux.
e1020413 866If you are using "commercial" Unixes you are most probably I<not>
22b6f60d
JH
867using GNU libc and you can ignore C<LANGUAGE>.
868
869However, in the case you are using C<LANGUAGE>: it affects the
870language of informational, warning, and error messages output by
871commands (in other words, it's like C<LC_MESSAGES>) but it has higher
96090e4f 872priority than C<LC_ALL>. Moreover, it's not a single value but
22b6f60d
JH
873instead a "path" (":"-separated list) of I<languages> (not locales).
874See the GNU C<gettext> library documentation for more information.
528d65ad 875
5f05dabc 876=item LC_CTYPE
877
878In the absence of C<LC_ALL>, C<LC_CTYPE> chooses the character type
879locale. In the absence of both C<LC_ALL> and C<LC_CTYPE>, C<LANG>
880chooses the character type locale.
881
882=item LC_COLLATE
883
14280422
DD
884In the absence of C<LC_ALL>, C<LC_COLLATE> chooses the collation
885(sorting) locale. In the absence of both C<LC_ALL> and C<LC_COLLATE>,
886C<LANG> chooses the collation locale.
5f05dabc 887
888=item LC_MONETARY
889
14280422
DD
890In the absence of C<LC_ALL>, C<LC_MONETARY> chooses the monetary
891formatting locale. In the absence of both C<LC_ALL> and C<LC_MONETARY>,
892C<LANG> chooses the monetary formatting locale.
5f05dabc 893
894=item LC_NUMERIC
895
896In the absence of C<LC_ALL>, C<LC_NUMERIC> chooses the numeric format
897locale. In the absence of both C<LC_ALL> and C<LC_NUMERIC>, C<LANG>
898chooses the numeric format.
899
900=item LC_TIME
901
14280422
DD
902In the absence of C<LC_ALL>, C<LC_TIME> chooses the date and time
903formatting locale. In the absence of both C<LC_ALL> and C<LC_TIME>,
904C<LANG> chooses the date and time formatting locale.
5f05dabc 905
906=item LANG
907
14280422
DD
908C<LANG> is the "catch-all" locale environment variable. If it is set, it
909is used as the last resort after the overall C<LC_ALL> and the
5f05dabc 910category-specific C<LC_...>.
911
912=back
913
7e4353e9
RGS
914=head2 Examples
915
916The LC_NUMERIC controls the numeric output:
917
918 use locale;
919 use POSIX qw(locale_h); # Imports setlocale() and the LC_ constants.
920 setlocale(LC_NUMERIC, "fr_FR") or die "Pardon";
921 printf "%g\n", 1.23; # If the "fr_FR" succeeded, probably shows 1,23.
922
923and also how strings are parsed by POSIX::strtod() as numbers:
924
925 use locale;
926 use POSIX qw(locale_h strtod);
2095dafa 927 setlocale(LC_NUMERIC, "de_DE") or die "Entschuldigung";
7e4353e9
RGS
928 my $x = strtod("2,34") + 5;
929 print $x, "\n"; # Probably shows 7,34.
930
5f05dabc 931=head1 NOTES
932
933=head2 Backward compatibility
934
b0c42ed9 935Versions of Perl prior to 5.004 B<mostly> ignored locale information,
5a964f20
TC
936generally behaving as if something similar to the C<"C"> locale were
937always in force, even if the program environment suggested otherwise
938(see L<The setlocale function>). By default, Perl still behaves this
939way for backward compatibility. If you want a Perl application to pay
940attention to locale information, you B<must> use the S<C<use locale>>
b687b08b 941pragma (see L<The use locale pragma>) to instruct it to do so.
b0c42ed9
JH
942
943Versions of Perl from 5.002 to 5.003 did use the C<LC_CTYPE>
5a964f20
TC
944information if available; that is, C<\w> did understand what
945were the letters according to the locale environment variables.
b0c42ed9
JH
946The problem was that the user had no control over the feature:
947if the C library supported locales, Perl used them.
948
949=head2 I18N:Collate obsolete
950
5a964f20 951In versions of Perl prior to 5.004, per-locale collation was possible
b0c42ed9
JH
952using the C<I18N::Collate> library module. This module is now mildly
953obsolete and should be avoided in new applications. The C<LC_COLLATE>
954functionality is now integrated into the Perl core language: One can
955use locale-specific scalar data completely normally with C<use locale>,
956so there is no longer any need to juggle with the scalar references of
957C<I18N::Collate>.
5f05dabc 958
14280422 959=head2 Sort speed and memory use impacts
5f05dabc 960
961Comparing and sorting by locale is usually slower than the default
14280422
DD
962sorting; slow-downs of two to four times have been observed. It will
963also consume more memory: once a Perl scalar variable has participated
964in any string comparison or sorting operation obeying the locale
965collation rules, it will take 3-15 times more memory than before. (The
966exact multiplier depends on the string's contents, the operating system
967and the locale.) These downsides are dictated more by the operating
968system's implementation of the locale system than by Perl.
5f05dabc 969
e38874e2
DD
970=head2 write() and LC_NUMERIC
971
903eb63f
NT
972If a program's environment specifies an LC_NUMERIC locale and C<use
973locale> is in effect when the format is declared, the locale is used
974to specify the decimal point character in formatted output. Formatted
975output cannot be controlled by C<use locale> at the time when write()
976is called.
e38874e2 977
5f05dabc 978=head2 Freely available locale definitions
979
08d7a6b2
LB
980There is a large collection of locale definitions at:
981
982 http://std.dkuug.dk/i18n/WG15-collection/locales/
983
984You should be aware that it is
14280422 985unsupported, and is not claimed to be fit for any purpose. If your
5a964f20 986system allows installation of arbitrary locales, you may find the
14280422
DD
987definitions useful as they are, or as a basis for the development of
988your own locales.
5f05dabc 989
14280422 990=head2 I18n and l10n
5f05dabc 991
b0c42ed9
JH
992"Internationalization" is often abbreviated as B<i18n> because its first
993and last letters are separated by eighteen others. (You may guess why
994the internalin ... internaliti ... i18n tends to get abbreviated.) In
995the same way, "localization" is often abbreviated to B<l10n>.
14280422
DD
996
997=head2 An imperfect standard
998
999Internationalization, as defined in the C and POSIX standards, can be
1000criticized as incomplete, ungainly, and having too large a granularity.
1001(Locales apply to a whole process, when it would arguably be more useful
1002to have them apply to a single thread, window group, or whatever.) They
1003also have a tendency, like standards groups, to divide the world into
1004nations, when we all know that the world can equally well be divided
e199995e 1005into bankers, bikers, gamers, and so on.
5f05dabc 1006
b310b053
JH
1007=head1 Unicode and UTF-8
1008
e199995e 1009The support of Unicode is new starting from Perl version 5.6, and more fully
b4ffc3db
TC
1010implemented in version 5.8 and later. See L<perluniintro>. Perl tries to
1011work with both Unicode and locales--but of course, there are problems.
e199995e
KW
1012
1013Perl does not handle multi-byte locales, such as have been used for various
b4ffc3db
TC
1014Asian languages, such as Big5 or Shift JIS. However, the increasingly common
1015multi-byte UTF-8 locales, if properly implemented, tend to work
1016reasonably well in Perl, simply because both they and Perl store
e199995e
KW
1017characters that take up multiple bytes the same way.
1018
1019Perl generally takes the tack to use locale rules on code points that can fit
1020in a single byte, and Unicode rules for those that can't (though this wasn't
1021uniformly applied prior to Perl 5.14). This prevents many problems in locales
1022that aren't UTF-8. Suppose the locale is ISO8859-7, Greek. The character at
10230xD7 there is a capital Chi. But in the ISO8859-1 locale, Latin1, it is a
1024multiplication sign. The POSIX regular expression character class
b4ffc3db
TC
1025C<[[:alpha:]]> will magically match 0xD7 in the Greek locale but not in the
1026Latin one, even if the string is encoded in UTF-8, which would normally imply
1027Unicode semantics. (The "U" in UTF-8 stands for Unicode.)
e199995e
KW
1028
1029However, there are places where this breaks down. Certain constructs are
b4ffc3db
TC
1030for Unicode only, such as C<\p{Alpha}>. They assume that 0xD7 always has its
1031Unicode meaning (or the equivalent on EBCDIC platforms). Since Latin1 is a
1032subset of Unicode and 0xD7 is the multiplication sign in both Latin1 and
1033Unicode, C<\p{Alpha}> will never match it, regardless of locale. A similar
1034issue occurs with C<\N{...}>. It is therefore a bad idea to use C<\p{}> or
1035C<\N{}> under C<use locale>--I<unless> you can guarantee that the locale will
1036be a ISO8859-1 or UTF-8 one. Use POSIX character classes instead.
1037
e199995e
KW
1038
1039The same problem ensues if you enable automatic UTF-8-ification of your
1040standard file handles, default C<open()> layer, and C<@ARGV> on non-ISO8859-1,
b4ffc3db
TC
1041non-UTF-8 locales (by using either the B<-C> command line switch or the
1042C<PERL_UNICODE> environment variable; see L<perlrun>).
1043Things are read in as UTF-8, which would normally imply a Unicode
1044interpretation, but the presence of a locale causes them to be interpreted
1045in that locale instead. For example, a 0xD7 code point in the Unicode
1046input, which should mean the multiplication sign, won't be interpreted by
1047Perl that way under the Greek locale. Again, this is not a problem
1048I<provided> you make certain that all locales will always and only be either
1049an ISO8859-1 or a UTF-8 locale.
1050
1051Vendor locales are notoriously buggy, and it is difficult for Perl to test
1052its locale-handling code because this interacts with code that Perl has no
1053control over; therefore the locale-handling code in Perl may be buggy as
1054well. But if you I<do> have locales that work, using them may be
1055worthwhile for certain specific purposes, as long as you keep in mind the
1056gotchas already mentioned. For example, collation runs faster under
1057locales than under L<Unicode::Collate> (albeit with less flexibility), and
1058you gain access to such things as the local currency symbol and the names
1059of the months and days of the week.
b310b053 1060
5f05dabc 1061=head1 BUGS
1062
1063=head2 Broken systems
1064
5a964f20 1065In certain systems, the operating system's locale support
2bdf8add 1066is broken and cannot be fixed or used by Perl. Such deficiencies can
b4ffc3db 1067and will result in mysterious hangs and/or Perl core dumps when
2bdf8add 1068C<use locale> is in effect. When confronted with such a system,
7f2de2d2 1069please report in excruciating detail to <F<perlbug@perl.org>>, and
b4ffc3db 1070also contact your vendor: bug fixes may exist for these problems
2bdf8add
JH
1071in your operating system. Sometimes such bug fixes are called an
1072operating system upgrade.
5f05dabc 1073
1074=head1 SEE ALSO
1075
b310b053
JH
1076L<I18N::Langinfo>, L<perluniintro>, L<perlunicode>, L<open>,
1077L<POSIX/isalnum>, L<POSIX/isalpha>,
4bbcc6e8
JH
1078L<POSIX/isdigit>, L<POSIX/isgraph>, L<POSIX/islower>,
1079L<POSIX/isprint>, L<POSIX/ispunct>, L<POSIX/isspace>,
1080L<POSIX/isupper>, L<POSIX/isxdigit>, L<POSIX/localeconv>,
1081L<POSIX/setlocale>, L<POSIX/strcoll>, L<POSIX/strftime>,
1082L<POSIX/strtod>, L<POSIX/strxfrm>.
5f05dabc 1083
1084=head1 HISTORY
1085
b0c42ed9 1086Jarkko Hietaniemi's original F<perli18n.pod> heavily hacked by Dominic
5a964f20
TC
1087Dunlop, assisted by the perl5-porters. Prose worked over a bit by
1088Tom Christiansen.