Debian Codegraph @

upstream/opensuse-tumbleweed/man3/I18N::Langinfo.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "I18N::Langinfo 3pm"
61 .TH I18N::Langinfo 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 I18N::Langinfo \- query locale information
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& use I18N::Langinfo;
72 .Ve
73 .SH DESCRIPTION
74 .IX Header "DESCRIPTION"
75 The \fBlanginfo()\fR function queries various locale information that can be
76 used to localize output and user interfaces. It uses the current underlying
77 locale, regardless of whether or not it was called from within the scope of
78 \&\f(CW\*(C`use\ locale\*(C'\fR. The \fBlanginfo()\fR function requires
79 one numeric argument that identifies the locale constant to query:
80 if no argument is supplied, \f(CW$_\fR is used. The numeric constants
81 appropriate to be used as arguments are exportable from I18N::Langinfo.
82 .PP
83 The following example will import the \fBlanginfo()\fR function itself and
84 three constants to be used as arguments to \fBlanginfo()\fR: a constant for
85 the abbreviated first day of the week (the numbering starts from
86 Sunday = 1) and two more constants for the affirmative and negative
87 answers for a yes/no question in the current locale.
88 .PP
89 .Vb 1
90 \& use I18N::Langinfo qw(langinfo ABDAY_1 YESSTR NOSTR);
91 \&
92 \& my ($abday_1, $yesstr, $nostr) =
93 \& map { langinfo($_) } (ABDAY_1, YESSTR, NOSTR);
94 \&
95 \& print "$abday_1? [$yesstr/$nostr] ";
96 .Ve
97 .PP
98 In other words, in the "C" (or English) locale the above will probably
99 print something like:
100 .PP
101 .Vb 1
102 \& Sun? [yes/no]
103 .Ve
104 .PP
105 but under a French locale
106 .PP
107 .Vb 1
108 \& dim? [oui/non]
109 .Ve
110 .PP
111 The usually available constants are as follows.
112 .IP \(bu 4
113 For abbreviated and full length days of the week and months of the year:
114 .Sp
115 .Vb 6
116 \& ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7
117 \& ABMON_1 ABMON_2 ABMON_3 ABMON_4 ABMON_5 ABMON_6
118 \& ABMON_7 ABMON_8 ABMON_9 ABMON_10 ABMON_11 ABMON_12
119 \& DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7
120 \& MON_1 MON_2 MON_3 MON_4 MON_5 MON_6
121 \& MON_7 MON_8 MON_9 MON_10 MON_11 MON_12
122 .Ve
123 .IP \(bu 4
124 For the date\-time, date, and time formats used by the \fBstrftime()\fR function
125 (see POSIX):
126 .Sp
127 .Vb 1
128 \& D_T_FMT D_FMT T_FMT
129 .Ve
130 .IP \(bu 4
131 For the locales for which it makes sense to have ante meridiem and post
132 meridiem time formats:
133 .Sp
134 .Vb 1
135 \& AM_STR PM_STR T_FMT_AMPM
136 .Ve
137 .IP \(bu 4
138 For the character code set being used (such as "ISO8859\-1", "cp850",
139 "koi8\-r", "sjis", "utf8", etc.):
140 .Sp
141 .Vb 1
142 \& CODESET
143 .Ve
144 .IP \(bu 4
145 For the symbol or string of characters that indicates a number is a monetary
146 value:
147 .Sp
148 .Vb 1
149 \& CRNCYSTR
150 .Ve
151 .Sp
152 An example is the dollar sign \f(CW\*(C`$\*(C'\fR. Some locales not associated with
153 particular locations may have an empty currency string. (The C locale is
154 one.) Otherwise, the return of this is always prefixed by one of these three
155 characters:
156 .RS 4
157 .ie n .IP """\-""" 4
158 .el .IP \f(CW\-\fR 4
159 .IX Item "-"
160 indicates that in this locale, the string precedes the numeric value, as in a
161 U.S. locale: \f(CW\*(C`$9.95\*(C'\fR.
162 .ie n .IP """+""" 4
163 .el .IP \f(CW+\fR 4
164 .IX Item "+"
165 indicates that in this locale, the string follows the numeric value, like
166 \&\f(CW\*(C`9.95USD\*(C'\fR.
167 .ie n .IP """.""" 4
168 .el .IP \f(CW.\fR 4
169 .IX Item "."
170 indicates that in this locale, the string replaces the radix character, like
171 \&\f(CW\*(C`9$95\*(C'\fR.
172 .RE
173 .RS 4
174 .RE
175 .IP \(bu 4
176 For the radix character used between the integer and the fractional part of
177 decimal numbers, and the group separator string for large\-ish floating point
178 numbers (yes, these are redundant with
179 \&\fBPOSIX::localeconv()\fR):
180 .Sp
181 .Vb 1
182 \& RADIXCHAR THOUSEP
183 .Ve
184 .IP \(bu 4
185 For any alternate digits used in this locale besides the standard \f(CW0..9\fR:
186 .Sp
187 .Vb 1
188 \& ALT_DIGITS
189 .Ve
190 .Sp
191 This returns a sequence of alternate numeric reprsesentations for the numbers
192 \&\f(CW0\fR ... up to \f(CW99\fR. The representations are returned in a single string,
193 with a semi\-colon \f(CW\*(C`;\*(C'\fR used to separated the individual ones.
194 .Sp
195 Most locales don\*(Aqt have alternate digits, so the string will be empty.
196 .Sp
197 To access this data conveniently, you could do something like
198 .Sp
199 .Vb 2
200 \& use I18N::Langinfo qw(langinfo ALT_DIGITS);
201 \& my @alt_digits = split \*(Aq;\*(Aq, langinfo(ALT_DIGITS);
202 .Ve
203 .Sp
204 The array \f(CW@alt_digits\fR will contain 0 elements if the current locale doesn\*(Aqt
205 have alternate digits specified for it. Otherwise, it will have as many
206 elements as the locale defines, with \f(CW\*(C`[0]\*(C'\fR containing the alternate digit for
207 zero; \f(CW\*(C`[1]\*(C'\fR for one; and so forth, up to potentially \f(CW\*(C`[99]\*(C'\fR for the
208 alternate representation of ninety\-nine.
209 .Sp
210 Be aware that the alternate representation in some locales for the numbers
211 0..9 will have a leading alternate\-zero, so would look like the equivalent of
212 00..09.
213 .Sp
214 Running this program
215 .Sp
216 .Vb 4
217 \& use I18N::Langinfo qw(langinfo ALT_DIGITS);
218 \& my @alt_digits = split \*(Aq;\*(Aq, langinfo(ALT_DIGITS);
219 \& splice @alt_digits, 15;
220 \& print join " ", @alt_digits, "\en";
221 .Ve
222 .Sp
223 on a Japanese locale yields
224 .Sp
225 \&\f(CW\*(C`〇\ 一\ 二\ 三\ 四\ 五\ 六\ 七\ 八\ 九\ 十\ 十一\ 十二\ 十三\ 十四\*(C'\fR
226 .Sp
227 on some platforms.
228 .IP \(bu 4
229 For the affirmative and negative responses and expressions:
230 .Sp
231 .Vb 1
232 \& YESSTR YESEXPR NOSTR NOEXPR
233 .Ve
234 .IP \(bu 4
235 For the eras based on typically some ruler, such as the Japanese Emperor
236 (naturally only defined in the appropriate locales):
237 .Sp
238 .Vb 1
239 \& ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT
240 .Ve
241 .PP
242 In addition, Linux boxes have extra items, as follows. (When called from
243 other platform types, these return a stub value, of not much use.)
244 .ie n .IP """_NL_ADDRESS_POSTAL_FMT""" 4
245 .el .IP \f(CW_NL_ADDRESS_POSTAL_FMT\fR 4
246 .IX Item "_NL_ADDRESS_POSTAL_FMT"
247 .PD 0
248 .ie n .IP """_NL_ADDRESS_COUNTRY_NAME""" 4
249 .el .IP \f(CW_NL_ADDRESS_COUNTRY_NAME\fR 4
250 .IX Item "_NL_ADDRESS_COUNTRY_NAME"
251 .ie n .IP """_NL_ADDRESS_COUNTRY_POST""" 4
252 .el .IP \f(CW_NL_ADDRESS_COUNTRY_POST\fR 4
253 .IX Item "_NL_ADDRESS_COUNTRY_POST"
254 .ie n .IP """_NL_ADDRESS_COUNTRY_AB2""" 4
255 .el .IP \f(CW_NL_ADDRESS_COUNTRY_AB2\fR 4
256 .IX Item "_NL_ADDRESS_COUNTRY_AB2"
257 .ie n .IP """_NL_ADDRESS_COUNTRY_AB3""" 4
258 .el .IP \f(CW_NL_ADDRESS_COUNTRY_AB3\fR 4
259 .IX Item "_NL_ADDRESS_COUNTRY_AB3"
260 .ie n .IP """_NL_ADDRESS_COUNTRY_CAR""" 4
261 .el .IP \f(CW_NL_ADDRESS_COUNTRY_CAR\fR 4
262 .IX Item "_NL_ADDRESS_COUNTRY_CAR"
263 .ie n .IP """_NL_ADDRESS_COUNTRY_NUM""" 4
264 .el .IP \f(CW_NL_ADDRESS_COUNTRY_NUM\fR 4
265 .IX Item "_NL_ADDRESS_COUNTRY_NUM"
266 .ie n .IP """_NL_ADDRESS_COUNTRY_ISBN""" 4
267 .el .IP \f(CW_NL_ADDRESS_COUNTRY_ISBN\fR 4
268 .IX Item "_NL_ADDRESS_COUNTRY_ISBN"
269 .ie n .IP """_NL_ADDRESS_LANG_NAME""" 4
270 .el .IP \f(CW_NL_ADDRESS_LANG_NAME\fR 4
271 .IX Item "_NL_ADDRESS_LANG_NAME"
272 .ie n .IP """_NL_ADDRESS_LANG_AB""" 4
273 .el .IP \f(CW_NL_ADDRESS_LANG_AB\fR 4
274 .IX Item "_NL_ADDRESS_LANG_AB"
275 .ie n .IP """_NL_ADDRESS_LANG_TERM""" 4
276 .el .IP \f(CW_NL_ADDRESS_LANG_TERM\fR 4
277 .IX Item "_NL_ADDRESS_LANG_TERM"
278 .ie n .IP """_NL_ADDRESS_LANG_LIB""" 4
279 .el .IP \f(CW_NL_ADDRESS_LANG_LIB\fR 4
280 .IX Item "_NL_ADDRESS_LANG_LIB"
281 .PD
282 On Linux boxes, these return information about the country for the current
283 locale. Further information is found in \fIlanginfo.h\fR
284 .ie n .IP """_NL_IDENTIFICATION_TITLE""" 4
285 .el .IP \f(CW_NL_IDENTIFICATION_TITLE\fR 4
286 .IX Item "_NL_IDENTIFICATION_TITLE"
287 .PD 0
288 .ie n .IP """_NL_IDENTIFICATION_SOURCE""" 4
289 .el .IP \f(CW_NL_IDENTIFICATION_SOURCE\fR 4
290 .IX Item "_NL_IDENTIFICATION_SOURCE"
291 .ie n .IP """_NL_IDENTIFICATION_ADDRESS""" 4
292 .el .IP \f(CW_NL_IDENTIFICATION_ADDRESS\fR 4
293 .IX Item "_NL_IDENTIFICATION_ADDRESS"
294 .ie n .IP """_NL_IDENTIFICATION_CONTACT""" 4
295 .el .IP \f(CW_NL_IDENTIFICATION_CONTACT\fR 4
296 .IX Item "_NL_IDENTIFICATION_CONTACT"
297 .ie n .IP """_NL_IDENTIFICATION_EMAIL""" 4
298 .el .IP \f(CW_NL_IDENTIFICATION_EMAIL\fR 4
299 .IX Item "_NL_IDENTIFICATION_EMAIL"
300 .ie n .IP """_NL_IDENTIFICATION_TEL""" 4
301 .el .IP \f(CW_NL_IDENTIFICATION_TEL\fR 4
302 .IX Item "_NL_IDENTIFICATION_TEL"
303 .ie n .IP """_NL_IDENTIFICATION_FAX""" 4
304 .el .IP \f(CW_NL_IDENTIFICATION_FAX\fR 4
305 .IX Item "_NL_IDENTIFICATION_FAX"
306 .ie n .IP """_NL_IDENTIFICATION_LANGUAGE""" 4
307 .el .IP \f(CW_NL_IDENTIFICATION_LANGUAGE\fR 4
308 .IX Item "_NL_IDENTIFICATION_LANGUAGE"
309 .ie n .IP """_NL_IDENTIFICATION_TERRITORY""" 4
310 .el .IP \f(CW_NL_IDENTIFICATION_TERRITORY\fR 4
311 .IX Item "_NL_IDENTIFICATION_TERRITORY"
312 .ie n .IP """_NL_IDENTIFICATION_AUDIENCE""" 4
313 .el .IP \f(CW_NL_IDENTIFICATION_AUDIENCE\fR 4
314 .IX Item "_NL_IDENTIFICATION_AUDIENCE"
315 .ie n .IP """_NL_IDENTIFICATION_APPLICATION""" 4
316 .el .IP \f(CW_NL_IDENTIFICATION_APPLICATION\fR 4
317 .IX Item "_NL_IDENTIFICATION_APPLICATION"
318 .ie n .IP """_NL_IDENTIFICATION_ABBREVIATION""" 4
319 .el .IP \f(CW_NL_IDENTIFICATION_ABBREVIATION\fR 4
320 .IX Item "_NL_IDENTIFICATION_ABBREVIATION"
321 .ie n .IP """_NL_IDENTIFICATION_REVISION""" 4
322 .el .IP \f(CW_NL_IDENTIFICATION_REVISION\fR 4
323 .IX Item "_NL_IDENTIFICATION_REVISION"
324 .ie n .IP """_NL_IDENTIFICATION_DATE""" 4
325 .el .IP \f(CW_NL_IDENTIFICATION_DATE\fR 4
326 .IX Item "_NL_IDENTIFICATION_DATE"
327 .ie n .IP """_NL_IDENTIFICATION_CATEGORY""" 4
328 .el .IP \f(CW_NL_IDENTIFICATION_CATEGORY\fR 4
329 .IX Item "_NL_IDENTIFICATION_CATEGORY"
330 .PD
331 On Linux boxes, these return meta information about the current locale,
332 such as how to get in touch with its maintainers.
333 Further information is found in \fIlanginfo.h\fR
334 .ie n .IP """_NL_MEASUREMENT_MEASUREMENT""" 4
335 .el .IP \f(CW_NL_MEASUREMENT_MEASUREMENT\fR 4
336 .IX Item "_NL_MEASUREMENT_MEASUREMENT"
337 On Linux boxes, it returns 1 if the metric system of measurement prevails in
338 the locale; or 2 if US customary units prevail.
339 .ie n .IP """_NL_NAME_NAME_FMT""" 4
340 .el .IP \f(CW_NL_NAME_NAME_FMT\fR 4
341 .IX Item "_NL_NAME_NAME_FMT"
342 .PD 0
343 .ie n .IP """_NL_NAME_NAME_GEN""" 4
344 .el .IP \f(CW_NL_NAME_NAME_GEN\fR 4
345 .IX Item "_NL_NAME_NAME_GEN"
346 .ie n .IP """_NL_NAME_NAME_MR""" 4
347 .el .IP \f(CW_NL_NAME_NAME_MR\fR 4
348 .IX Item "_NL_NAME_NAME_MR"
349 .ie n .IP """_NL_NAME_NAME_MRS""" 4
350 .el .IP \f(CW_NL_NAME_NAME_MRS\fR 4
351 .IX Item "_NL_NAME_NAME_MRS"
352 .ie n .IP """_NL_NAME_NAME_MISS""" 4
353 .el .IP \f(CW_NL_NAME_NAME_MISS\fR 4
354 .IX Item "_NL_NAME_NAME_MISS"
355 .ie n .IP """_NL_NAME_NAME_MS""" 4
356 .el .IP \f(CW_NL_NAME_NAME_MS\fR 4
357 .IX Item "_NL_NAME_NAME_MS"
358 .PD
359 On Linux boxes, these return information about how names are formatted and
360 the personal salutations used in the current locale. Further information
361 is found in \fBlocale\fR\|(7) and \fIlanginfo.h\fR
362 .ie n .IP """_NL_PAPER_HEIGHT""" 4
363 .el .IP \f(CW_NL_PAPER_HEIGHT\fR 4
364 .IX Item "_NL_PAPER_HEIGHT"
365 .PD 0
366 .ie n .IP """_NL_PAPER_WIDTH""" 4
367 .el .IP \f(CW_NL_PAPER_WIDTH\fR 4
368 .IX Item "_NL_PAPER_WIDTH"
369 .PD
370 On Linux boxes, these return the standard size of sheets of paper (in
371 millimeters) in the current locale.
372 .ie n .IP """_NL_TELEPHONE_TEL_INT_FMT""" 4
373 .el .IP \f(CW_NL_TELEPHONE_TEL_INT_FMT\fR 4
374 .IX Item "_NL_TELEPHONE_TEL_INT_FMT"
375 .PD 0
376 .ie n .IP """_NL_TELEPHONE_TEL_DOM_FMT""" 4
377 .el .IP \f(CW_NL_TELEPHONE_TEL_DOM_FMT\fR 4
378 .IX Item "_NL_TELEPHONE_TEL_DOM_FMT"
379 .ie n .IP """_NL_TELEPHONE_INT_SELECT""" 4
380 .el .IP \f(CW_NL_TELEPHONE_INT_SELECT\fR 4
381 .IX Item "_NL_TELEPHONE_INT_SELECT"
382 .ie n .IP """_NL_TELEPHONE_INT_PREFIX""" 4
383 .el .IP \f(CW_NL_TELEPHONE_INT_PREFIX\fR 4
384 .IX Item "_NL_TELEPHONE_INT_PREFIX"
385 .PD
386 On Linux boxes, these return information about how telephone numbers are
387 formatted (both domestically and international calling) in the current locale.
388 Further information is found in \fIlanginfo.h\fR
389 .ie n .SS "For systems without ""nl_langinfo"""
390 .el .SS "For systems without \f(CWnl_langinfo\fP"
391 .IX Subsection "For systems without nl_langinfo"
392 This module originally was just a wrapper for the libc \f(CW\*(C`nl_langinfo\*(C'\fR
393 function, and did not work on systems lacking it, such as Windows.
394 .PP
395 Starting in Perl 5.28, this module works on all platforms. When
396 \&\f(CW\*(C`nl_langinfo\*(C'\fR is not available, it uses various methods to construct
397 what that function, if present, would return. But there are potential
398 glitches. These are the items that could be different:
399 .ie n .IP """ERA""" 4
400 .el .IP \f(CWERA\fR 4
401 .IX Item "ERA"
402 Unimplemented, so returns \f(CW""\fR.
403 .ie n .IP """CODESET""" 4
404 .el .IP \f(CWCODESET\fR 4
405 .IX Item "CODESET"
406 This should work properly for Windows platforms. On almost all other modern
407 platforms, it will reliably return "UTF\-8" if that is the code set.
408 Otherwise, it depends on the locale\*(Aqs name. If that is of the form
409 \&\f(CW\*(C`foo.bar\*(C'\fR, it will assume \f(CW\*(C`bar\*(C'\fR is the code set; and it also knows about the
410 two locales "C" and "POSIX". If none of those apply it returns \f(CW""\fR.
411 .ie n .IP """YESEXPR""" 4
412 .el .IP \f(CWYESEXPR\fR 4
413 .IX Item "YESEXPR"
414 .PD 0
415 .ie n .IP """YESSTR""" 4
416 .el .IP \f(CWYESSTR\fR 4
417 .IX Item "YESSTR"
418 .ie n .IP """NOEXPR""" 4
419 .el .IP \f(CWNOEXPR\fR 4
420 .IX Item "NOEXPR"
421 .ie n .IP """NOSTR""" 4
422 .el .IP \f(CWNOSTR\fR 4
423 .IX Item "NOSTR"
424 .PD
425 Only the values for English are returned. \f(CW\*(C`YESSTR\*(C'\fR and \f(CW\*(C`NOSTR\*(C'\fR have been
426 removed from POSIX 2008, and are retained here for backwards compatibility.
427 Your platform\*(Aqs \f(CW\*(C`nl_langinfo\*(C'\fR may not support them.
428 .ie n .IP """ALT_DIGITS""" 4
429 .el .IP \f(CWALT_DIGITS\fR 4
430 .IX Item "ALT_DIGITS"
431 On systems with a \f(CW\*(C`\fR\f(CBstrftime\fR\f(CW\|(3)\*(C'\fR that recognizes the POSIX\-defined \f(CW%O\fR
432 format modifier (not Windows), perl tries hard to return these. The result
433 likely will go as high as what \f(CWnl_langinfo()\fR would return, but not
434 necessarily; and the numbers from \f(CW0..9\fR will always be stripped of leading
435 zeros.
436 .Sp
437 Without \f(CW%O\fR, an empty string is always returned.
438 .ie n .IP """D_FMT""" 4
439 .el .IP \f(CWD_FMT\fR 4
440 .IX Item "D_FMT"
441 Always evaluates to \f(CW%x\fR, the locale\*(Aqs appropriate date representation.
442 .ie n .IP """T_FMT""" 4
443 .el .IP \f(CWT_FMT\fR 4
444 .IX Item "T_FMT"
445 Always evaluates to \f(CW%X\fR, the locale\*(Aqs appropriate time representation.
446 .ie n .IP """D_T_FMT""" 4
447 .el .IP \f(CWD_T_FMT\fR 4
448 .IX Item "D_T_FMT"
449 Always evaluates to \f(CW%c\fR, the locale\*(Aqs appropriate date and time
450 representation.
451 .ie n .IP """CRNCYSTR""" 4
452 .el .IP \f(CWCRNCYSTR\fR 4
453 .IX Item "CRNCYSTR"
454 The return may be incorrect for those rare locales where the currency symbol
455 replaces the radix character. If you have examples of it needing to work
456 differently, please file a report at <https://github.com/Perl/perl5/issues>.
457 .ie n .IP """ERA_D_FMT""" 4
458 .el .IP \f(CWERA_D_FMT\fR 4
459 .IX Item "ERA_D_FMT"
460 .PD 0
461 .ie n .IP """ERA_T_FMT""" 4
462 .el .IP \f(CWERA_T_FMT\fR 4
463 .IX Item "ERA_T_FMT"
464 .ie n .IP """ERA_D_T_FMT""" 4
465 .el .IP \f(CWERA_D_T_FMT\fR 4
466 .IX Item "ERA_D_T_FMT"
467 .ie n .IP """T_FMT_AMPM""" 4
468 .el .IP \f(CWT_FMT_AMPM\fR 4
469 .IX Item "T_FMT_AMPM"
470 .PD
471 These are derived by using \f(CWstrftime()\fR, and not all versions of that function
472 know about them. \f(CW""\fR is returned for these on such systems.
473 .ie n .IP "All ""_NL_\fIfoo\fR"" items" 4
474 .el .IP "All \f(CW_NL_\fR\f(CIfoo\fR\f(CW\fR items" 4
475 .IX Item "All _NL_foo items"
476 These return the same values as they do on boxes that don\*(Aqt have the
477 appropriate underlying locale categories.
478 .PP
479 See your \fBnl_langinfo\fR\|(3) for more information about the available
480 constants. (Often this means having to look directly at the
481 \&\fIlanginfo.h\fR C header file.)
482 .SS EXPORT
483 .IX Subsection "EXPORT"
484 By default only the \f(CWlanginfo()\fR function is exported.
485 .SH BUGS
486 .IX Header "BUGS"
487 Before Perl 5.28, the returned values are unreliable for the \f(CW\*(C`RADIXCHAR\*(C'\fR and
488 \&\f(CW\*(C`THOUSEP\*(C'\fR locale constants.
489 .PP
490 Starting in 5.28, changing locales on threaded builds is supported on systems
491 that offer thread\-safe locale functions. These include POSIX 2008 systems and
492 Windows starting with Visual Studio 2005, and this module will work properly
493 in such situations. However, on threaded builds on Windows prior to Visual
494 Studio 2015, retrieving the items \f(CW\*(C`CRNCYSTR\*(C'\fR and \f(CW\*(C`THOUSEP\*(C'\fR can result in a
495 race with a thread that has converted to use the global locale. It is quite
496 uncommon for a thread to have done this. It would be possible to construct a
497 workaround for this; patches welcome: see "switch_to_global_locale" in perlapi.
498 .SH "SEE ALSO"
499 .IX Header "SEE ALSO"
500 perllocale, "localeconv" in POSIX, "setlocale" in POSIX, \fBnl_langinfo\fR\|(3).
501 .SH AUTHOR
502 .IX Header "AUTHOR"
503 Jarkko Hietaniemi, <[email protected]>. Now maintained by Perl 5 porters.
504 .SH "COPYRIGHT AND LICENSE"
505 .IX Header "COPYRIGHT AND LICENSE"
506 Copyright 2001 by Jarkko Hietaniemi
507 .PP
508 This library is free software; you can redistribute it and/or modify
509 it under the same terms as Perl itself.