Print this page
12743 man page spelling mistakes
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man5/locale.5
+++ new/usr/src/man/man5/locale.5
1 1 .\"
2 2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 3 .\" permission to reproduce portions of its copyrighted documentation.
4 4 .\" Original documentation from The Open Group can be obtained online at
5 5 .\" http://www.opengroup.org/bookstore/.
6 6 .\"
7 7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 8 .\" Group, have given us permission to reprint portions of their
9 9 .\" documentation.
10 10 .\"
11 11 .\" In the following statement, the phrase ``this text'' refers to portions
12 12 .\" of the system documentation.
13 13 .\"
14 14 .\" Portions of this text are reprinted and reproduced in electronic form
15 15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 16 .\" Standard for Information Technology -- Portable Operating System
17 17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 20 .\" between these versions and the original IEEE and The Open Group
21 21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 22 .\" document. The original Standard can be obtained online at
23 23 .\" http://www.opengroup.org/unix/online.html.
24 24 .\"
25 25 .\" This notice shall appear on any product containing this material.
26 26 .\"
27 27 .\" The contents of this file are subject to the terms of the
28 28 .\" Common Development and Distribution License (the "License").
29 29 .\" You may not use this file except in compliance with the License.
30 30 .\"
31 31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 32 .\" or http://www.opensolaris.org/os/licensing.
33 33 .\" See the License for the specific language governing permissions
34 34 .\" and limitations under the License.
35 35 .\"
↓ open down ↓ |
35 lines elided |
↑ open up ↑ |
36 36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 38 .\" If applicable, add the following below this CDDL HEADER, with the
39 39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 41 .\"
42 42 .\"
43 43 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
44 44 .\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
45 45 .\"
46 -.TH LOCALE 5 "April 9, 2016"
46 +.TH LOCALE 5 "May 16, 2020"
47 47 .SH NAME
48 48 locale \- subset of a user's environment that depends on language and cultural
49 49 conventions
50 50 .SH DESCRIPTION
51 -.LP
52 51 A \fBlocale\fR is the definition of the subset of a user's environment that
53 52 depends on language and cultural conventions. It is made up from one or more
54 53 categories. Each category is identified by its name and controls specific
55 54 aspects of the behavior of components of the system. Category names correspond
56 55 to the following environment variable names:
57 56 .sp
58 57 .ne 2
59 58 .na
60 59 \fB\fBLC_CTYPE\fR\fR
61 60 .ad
62 61 .RS 15n
63 62 Character classification and case conversion.
64 63 .RE
65 64
66 65 .sp
67 66 .ne 2
68 67 .na
69 68 \fB\fBLC_COLLATE\fR\fR
70 69 .ad
71 70 .RS 15n
72 71 Collation order.
73 72 .RE
74 73
75 74 .sp
76 75 .ne 2
77 76 .na
78 77 \fB\fBLC_TIME\fR\fR
79 78 .ad
80 79 .RS 15n
81 80 Date and time formats.
82 81 .RE
83 82
84 83 .sp
85 84 .ne 2
86 85 .na
87 86 \fB\fBLC_NUMERIC\fR\fR
88 87 .ad
89 88 .RS 15n
90 89 Numeric formatting.
91 90 .RE
92 91
93 92 .sp
94 93 .ne 2
95 94 .na
96 95 \fB\fBLC_MONETARY\fR\fR
97 96 .ad
98 97 .RS 15n
99 98 Monetary formatting.
100 99 .RE
101 100
102 101 .sp
103 102 .ne 2
104 103 .na
105 104 \fB\fBLC_MESSAGES\fR\fR
106 105 .ad
107 106 .RS 15n
108 107 Formats of informative and diagnostic messages and interactive responses.
109 108 .RE
110 109
111 110 .sp
112 111 .LP
113 112 The standard utilities base their behavior on the current locale, as defined
114 113 in the ENVIRONMENT VARIABLES section for each utility. The behavior of some of
115 114 the C-language functions will also be modified based on the current locale, as
116 115 defined by the last call to \fBsetlocale\fR(3C).
117 116 .sp
118 117 .LP
119 118 Locales other than those supplied by the implementation can be created by the
120 119 application via the \fBlocaledef\fR(1) utility. The value that is used to
121 120 specify a locale when using environment variables will be the string specified
122 121 as the \fIname\fR operand to \fBlocaledef\fR when the locale was created. The
123 122 strings "C" and "POSIX" are reserved as identifiers for the POSIX locale.
124 123 .sp
125 124 .LP
126 125 Applications can select the desired locale by invoking the \fBsetlocale()\fR
127 126 function with the appropriate value. If the function is invoked with an empty
128 127 string, such as:
129 128 .sp
130 129 .in +2
131 130 .nf
↓ open down ↓ |
70 lines elided |
↑ open up ↑ |
132 131 setlocale(LC_ALL, "");
133 132 .fi
134 133 .in -2
135 134
136 135 .sp
137 136 .LP
138 137 the value of the corresponding environment variable is used. If the environment
139 138 variable is unset or is set to the empty string, the \fBsetlocale()\fR
140 139 function sets the appropriate environment.
141 140 .SS "Locale Definition"
142 -.LP
143 141 Locales can be described with the file format accepted by the \fBlocaledef\fR
144 142 utility.
145 143 .sp
146 144 .LP
147 145 The locale definition file must contain one or more locale category source
148 146 definitions, and must not contain more than one definition for the same locale
149 147 category.
150 148 .sp
151 149 .LP
152 150 A category source definition consists of a category header, a category body and
153 151 a category trailer. A category header consists of the character string naming
154 152 of the category, beginning with the characters \fBLC_\fR. The category trailer
155 153 consists of the string \fBEND\fR, followed by one or more blank characters and
156 154 the string used in the corresponding category header.
157 155 .sp
158 156 .LP
159 157 The category body consists of one or more lines of text. Each line contains an
160 158 identifier, optionally followed by one or more operands. Identifiers are either
161 159 keywords, identifying a particular locale element, or collating elements. Each
162 160 keyword within a locale must have a unique name (that is, two categories cannot
163 161 have a commonly-named keyword). No keyword can start with the characters
164 162 \fBLC_\fR. Identifiers must be separated from the operands by one or more blank
165 163 characters.
166 164 .sp
167 165 .LP
168 166 Operands must be characters, collating elements, or strings of characters.
169 167 Strings must be enclosed in double-quotes (\fB"\fR). Literal double-quotes
170 168 within strings must be preceded by the <\fIescape character\fR>, as described
171 169 below. When a keyword is followed by more than one operand, the operands must
172 170 be separated by semicolons (\fB;\fR). Blank characters are allowed both before
173 171 and after a semicolon.
174 172 .sp
175 173 .LP
176 174 The first category header in the file can be preceded by a line modifying the
177 175 comment character. It has the following format, starting in column 1:
178 176 .sp
179 177 .in +2
180 178 .nf
181 179 "comment_char %c\en",<\fIcomment character\fR>
182 180 .fi
183 181 .in -2
184 182
185 183 .sp
186 184 .LP
187 185 The comment character defaults to the number sign (\fB#\fR). Blank lines and
188 186 lines containing the <\fIcomment character\fR> in the first position are
189 187 ignored.
190 188 .sp
191 189 .LP
192 190 The first category header in the file can be preceded by a line modifying the
193 191 escape character to be used in the file. It has the following format, starting
194 192 in column 1:
195 193 .sp
196 194 .in +2
197 195 .nf
198 196 "escape_char %c\en",<\fIescape character\fR>
199 197 .fi
200 198 .in -2
201 199 .sp
202 200
203 201 .sp
204 202 .LP
205 203 The escape character defaults to backslash.
206 204 .sp
207 205 .LP
208 206 A line can be continued by placing an escape character as the last character on
209 207 the line; this continuation character will be discarded from the input.
210 208 Although the implementation need not accept any one portion of a continued line
211 209 with a length exceeding \fB{LINE_MAX}\fR bytes, it places no limits on the
212 210 accumulated length of the continued line. Comment lines cannot be continued on
213 211 a subsequent line using an escaped newline character.
214 212 .sp
215 213 .LP
216 214 Individual characters, characters in strings, and collating elements must be
217 215 represented using symbolic names, as defined below. In addition, characters can
218 216 be represented using the characters themselves or as octal, hexadecimal or
219 217 decimal constants. When non-symbolic notation is used, the resultant locale
220 218 definitions will in many cases not be portable between systems. The left angle
221 219 bracket (\fB<\fR) is a reserved symbol, denoting the start of a symbolic name;
222 220 when used to represent itself it must be preceded by the escape character. The
223 221 following rules apply to character representation:
224 222 .RS +4
225 223 .TP
226 224 1.
227 225 A character can be represented via a symbolic name, enclosed within angle
228 226 brackets \fB<\fR and \fB>\fR. The symbolic name, including the angle brackets,
229 227 must exactly match a symbolic name defined in the charmap file specified via
230 228 the \fBlocaledef\fR \fB-f\fR option, and will be replaced by a character value
231 229 determined from the value associated with the symbolic name in the charmap
232 230 file. The use of a symbolic name not found in the charmap file constitutes an
233 231 error, unless the category is \fBLC_CTYPE\fR or \fBLC_COLLATE\fR, in which
234 232 case it constitutes a warning condition (see \fBlocaledef\fR(1) for a
235 233 description of action resulting from errors and warnings). The specification of
236 234 a symbolic name in a \fBcollating-element\fR or \fBcollating-symbol\fR section
237 235 that duplicates a symbolic name in the charmap file (if present) is an error.
238 236 Use of the escape character or a right angle bracket within a symbolic name is
239 237 invalid unless the character is preceded by the escape character.
240 238 .sp
241 239 Example:
242 240 .sp
243 241 .in +2
244 242 .nf
245 243 <C>;<c-cedilla> "<M><a><y>"
246 244 .fi
247 245 .in -2
248 246 .sp
249 247
250 248 .RE
251 249 .RS +4
252 250 .TP
253 251 2.
254 252 A character can be represented by the character itself, in which case the
255 253 value of the character is implementation-dependent. Within a string, the
256 254 double-quote character, the escape character and the right angle bracket
257 255 character must be escaped (preceded by the escape character) to be interpreted
258 256 as the character itself. Outside strings, the characters
259 257 .sp
260 258 .in +2
261 259 .nf
262 260 \fB, ; < >\fR \fIescape_char\fR
263 261 .fi
264 262 .in -2
265 263 .sp
266 264
267 265 must be escaped to be interpreted as the character itself.
268 266 .sp
269 267 Example:
270 268 .sp
271 269 .in +2
272 270 .nf
273 271 c "May"
274 272 .fi
275 273 .in -2
276 274 .sp
277 275
278 276 .RE
279 277 .RS +4
280 278 .TP
281 279 3.
282 280 A character can be represented as an octal constant. An octal constant is
283 281 specified as the escape character followed by two or more octal digits. Each
284 282 constant represents a byte value. Multi-byte values can be represented by
285 283 concatenated constants specified in byte order with the last constant
286 284 specifying the least significant byte of the character.
287 285 .sp
288 286 Example:
289 287 .sp
290 288 .in +2
291 289 .nf
292 290 \e143;\e347;\e143\e150 "\e115\e141\e171"
293 291 .fi
294 292 .in -2
295 293 .sp
296 294
297 295 .RE
298 296 .RS +4
299 297 .TP
300 298 4.
301 299 A character can be represented as a hexadecimal constant. A hexadecimal
302 300 constant is specified as the escape character followed by an \fBx\fR followed
303 301 by two or more hexadecimal digits. Each constant represents a byte value.
304 302 Multi-byte values can be represented by concatenated constants specified in
305 303 byte order with the last constant specifying the least significant byte of the
306 304 character.
307 305 .sp
308 306 Example:
309 307 .sp
310 308 .in +2
311 309 .nf
312 310 \ex63;\exe7;\ex63\ex68 "\ex4d\ex61\ex79"
313 311 .fi
314 312 .in -2
315 313 .sp
316 314
317 315 .RE
318 316 .RS +4
319 317 .TP
320 318 5.
321 319 A character can be represented as a decimal constant. A decimal constant is
322 320 specified as the escape character followed by a \fBd\fR followed by two or more
323 321 decimal digits. Each constant represents a byte value. Multi-byte values can be
324 322 represented by concatenated constants specified in byte order with the last
325 323 constant specifying the least significant byte of the character.
326 324 .sp
327 325 Example:
328 326 .sp
329 327 .in +2
330 328 .nf
331 329 \ed99;\ed231;\ed99\ed104 "\ed77\ed97\ed121"
332 330 .fi
333 331 .in -2
↓ open down ↓ |
181 lines elided |
↑ open up ↑ |
334 332 .sp
335 333
336 334 Only characters existing in the character set for which the locale definition
337 335 is created can be specified, whether using symbolic names, the characters
338 336 themselves, or octal, decimal or hexadecimal constants. If a charmap file is
339 337 present, only characters defined in the charmap can be specified using octal,
340 338 decimal or hexadecimal constants. Symbolic names not present in the charmap
341 339 file can be specified and will be ignored, as specified under item 1 above.
342 340 .RE
343 341 .SS "LC_CTYPE"
344 -.LP
345 342 The \fBLC_CTYPE\fR category defines character classification, case conversion
346 343 and other character attributes. In addition, a series of characters can be
347 344 represented by three adjacent periods representing an ellipsis symbol
348 345 (\fB\&...\fR). The ellipsis specification is interpreted as meaning that all
349 346 values between the values preceding and following it represent valid
350 347 characters. The ellipsis specification is valid only within a single encoded
351 348 character set, that is, within a group of characters of the same size. An
352 349 ellipsis is interpreted as including in the list all characters with an encoded
353 350 value higher than the encoded value of the character preceding the ellipsis and
354 351 lower than the encoded value of the character following the ellipsis.
355 352 .sp
356 353 .LP
357 354 Example:
358 355 .sp
359 356 .in +2
360 357 .nf
361 358 \ex30;...;\ex39;
362 359 .fi
363 360 .in -2
364 361 .sp
365 362
366 363 .sp
367 364 .LP
368 365 includes in the character class all characters with encoded values between the
369 366 endpoints.
370 367 .sp
371 368 .LP
372 369 The following keywords are recognized. In the descriptions, the term
373 370 ``automatically included'' means that it is not an error either to include or
374 371 omit any of the referenced characters.
375 372 .sp
376 373 .LP
377 374 The character classes \fBdigit\fR, \fBxdigit\fR, \fBlower\fR, \fBupper\fR, and
378 375 \fBspace\fR have a set of automatically included characters. These only need to
379 376 be specified if the character values (that is, encoding) differ from the
380 377 implementation default values.
381 378 .sp
382 379 .ne 2
383 380 .na
384 381 \fB\fBupper\fR\fR
385 382 .ad
386 383 .RS 18n
387 384 Define characters to be classified as upper-case letters.
388 385 .sp
389 386 In the POSIX locale, the 26 upper-case letters are included:
390 387 .sp
391 388 .in +2
392 389 .nf
393 390 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
394 391 .fi
395 392 .in -2
396 393 .sp
397 394
398 395 In a locale definition file, no character specified for the keywords
399 396 \fBcntrl\fR, \fBdigit\fR, \fBpunct\fR, or \fBspace\fR can be specified. The
400 397 upper-case letters \fBA\fR to \fBZ\fR are automatically included in this class.
401 398 .RE
402 399
403 400 .sp
404 401 .ne 2
405 402 .na
406 403 \fB\fBlower\fR\fR
407 404 .ad
408 405 .RS 18n
409 406 Define characters to be classified as lower-case letters. In the POSIX locale,
410 407 the 26 lower-case letters are included:
411 408 .sp
412 409 .in +2
413 410 .nf
414 411 a b c d e f g h i j k l m n o p q r s t u v w x y z
415 412 .fi
416 413 .in -2
417 414 .sp
418 415
419 416 In a locale definition file, no character specified for the keywords
420 417 \fBcntrl\fR, \fBdigit\fR, \fBpunct\fR, or \fBspace\fR can be specified. The
421 418 lower-case letters \fBa\fR to \fBz\fR of the portable character set are
422 419 automatically included in this class.
423 420 .RE
424 421
425 422 .sp
426 423 .ne 2
427 424 .na
428 425 \fB\fBalpha\fR\fR
429 426 .ad
430 427 .RS 18n
431 428 Define characters to be classified as letters.
432 429 .sp
433 430 In the POSIX locale, all characters in the classes \fBupper\fR and \fBlower\fR
434 431 are included.
435 432 .sp
436 433 In a locale definition file, no character specified for the keywords
437 434 \fBcntrl\fR, \fBdigit\fR, \fBpunct\fR, or \fBspace\fR can be specified.
438 435 Characters classified as either \fBupper\fR or \fBlower\fR are automatically
439 436 included in this class.
440 437 .RE
441 438
442 439 .sp
443 440 .ne 2
444 441 .na
445 442 \fB\fBdigit\fR\fR
446 443 .ad
447 444 .RS 18n
448 445 Define the characters to be classified as numeric digits.
449 446 .sp
450 447 In the POSIX locale, only
451 448 .sp
452 449 .in +2
453 450 .nf
454 451 0 1 2 3 4 5 6 7 8 9
455 452 .fi
456 453 .in -2
457 454 .sp
458 455
459 456 are included.
460 457 .sp
461 458 In a locale definition file, only the digits \fB0\fR, \fB1\fR, \fB2\fR,
462 459 \fB3\fR, \fB4\fR, \fB5\fR, \fB6\fR, \fB7\fR, \fB8\fR, and \fB9\fR can be
463 460 specified, and in contiguous ascending sequence by numerical value. The digits
464 461 \fB0\fR to \fB9\fR of the portable character set are automatically included in
465 462 this class.
466 463 .sp
467 464 The definition of character class \fBdigit\fR requires that only ten
468 465 characters; the ones defining digits can be specified; alternative digits (for
469 466 example, Hindi or Kanji) cannot be specified here.
470 467 .RE
471 468
472 469 .sp
473 470 .ne 2
474 471 .na
475 472 \fB\fBalnum\fR\fR
476 473 .ad
477 474 .RS 18n
478 475 Define characters to be classified as letters and numeric digits. Only the
479 476 characters specified for the \fBalpha\fR and \fBdigit\fR keywords are
480 477 specified. Characters specified for the keywords \fBalpha\fR and \fBdigit\fR
481 478 are automatically included in this class.
482 479 .RE
483 480
484 481 .sp
485 482 .ne 2
486 483 .na
487 484 \fB\fBspace\fR\fR
488 485 .ad
489 486 .RS 18n
490 487 Define characters to be classified as white-space characters.
491 488 .sp
492 489 In the POSIX locale, at a minimum, the characters \fBSPACE\fR, \fBFORMFEED\fR,
493 490 \fBNEWLINE\fR, \fBCARRIAGE RETURN\fR, \fBTAB\fR, and \fBVERTICAL TAB\fR are
494 491 included.
495 492 .sp
496 493 In a locale definition file, no character specified for the keywords
497 494 \fBupper\fR, \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBgraph\fR, or
498 495 \fBxdigit\fR can be specified. The characters \fBSPACE\fR, \fBFORMFEED\fR,
499 496 \fBNEWLINE\fR, \fBCARRIAGE RETURN\fR, \fBTAB\fR, and \fBVERTICAL TAB\fR of the
500 497 portable character set, and any characters included in the class \fBblank\fR
501 498 are automatically included in this class.
502 499 .RE
503 500
504 501 .sp
505 502 .ne 2
506 503 .na
507 504 \fB\fBcntrl\fR\fR
508 505 .ad
509 506 .RS 18n
510 507 Define characters to be classified as control characters.
511 508 .sp
512 509 In the POSIX locale, no characters in classes \fBalpha\fR or \fBprint\fR are
513 510 included.
514 511 .sp
515 512 In a locale definition file, no character specified for the keywords
516 513 \fBupper\fR, \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBpunct\fR, \fBgraph\fR,
517 514 \fBprint\fR, or \fBxdigit\fR can be specified.
518 515 .RE
519 516
520 517 .sp
521 518 .ne 2
522 519 .na
523 520 \fB\fBpunct\fR\fR
524 521 .ad
525 522 .RS 18n
526 523 Define characters to be classified as punctuation characters.
527 524 .sp
528 525 In the POSIX locale, neither the space character nor any characters in classes
529 526 \fBalpha\fR, \fBdigit\fR, or \fBcntrl\fR are included.
530 527 .sp
531 528 In a locale definition file, no character specified for the keywords
532 529 \fBupper\fR, \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBcntrl\fR, \fBxdigit\fR
533 530 or as the space character can be specified.
534 531 .RE
535 532
536 533 .sp
537 534 .ne 2
538 535 .na
539 536 \fB\fBgraph\fR\fR
540 537 .ad
541 538 .RS 18n
542 539 Define characters to be classified as printable characters, not including the
543 540 space character.
544 541 .sp
545 542 In the POSIX locale, all characters in classes \fBalpha\fR, \fBdigit\fR, and
546 543 \fBpunct\fR are included; no characters in class \fBcntrl\fR are included.
547 544 .sp
548 545 In a locale definition file, characters specified for the keywords \fBupper\fR,
549 546 \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBxdigit\fR, and \fBpunct\fR are
550 547 automatically included in this class. No character specified for the keyword
551 548 \fBcntrl\fR can be specified.
552 549 .RE
553 550
554 551 .sp
555 552 .ne 2
556 553 .na
557 554 \fB\fBprint\fR\fR
558 555 .ad
559 556 .RS 18n
560 557 Define characters to be classified as printable characters, including the space
561 558 character.
562 559 .sp
563 560 In the POSIX locale, all characters in class \fBgraph\fR are included; no
564 561 characters in class \fBcntrl\fR are included.
565 562 .sp
566 563 In a locale definition file, characters specified for the keywords \fBupper\fR,
567 564 \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBxdigit\fR, \fBpunct\fR, and the space
568 565 character are automatically included in this class. No character specified for
569 566 the keyword \fBcntrl\fR can be specified.
570 567 .RE
571 568
572 569 .sp
573 570 .ne 2
574 571 .na
575 572 \fB\fBxdigit\fR\fR
576 573 .ad
577 574 .RS 18n
578 575 Define the characters to be classified as hexadecimal digits.
579 576 .sp
580 577 In the POSIX locale, only:
581 578 .sp
582 579 .in +2
583 580 .nf
584 581 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
585 582 .fi
586 583 .in -2
587 584 .sp
588 585
589 586 are included.
590 587 .sp
591 588 In a locale definition file, only the characters defined for the class
592 589 \fBdigit\fR can be specified, in contiguous ascending sequence by numerical
593 590 value, followed by one or more sets of six characters representing the
594 591 hexadecimal digits 10 to 15 inclusive, with each set in ascending order (for
595 592 example \fBA\fR, \fBB\fR, \fBC\fR, \fBD\fR, \fBE\fR, \fBF\fR, \fBa\fR, \fBb\fR,
596 593 \fBc\fR, \fBd\fR, \fBe\fR, \fBf\fR). The digits \fB0\fR to \fB9\fR, the
597 594 upper-case letters \fBA\fR to \fBF\fR and the lower-case letters \fBa\fR to
598 595 \fBf\fR of the portable character set are automatically included in this class.
599 596 .sp
600 597 The definition of character class \fBxdigit\fR requires that the characters
601 598 included in character class \fBdigit\fR be included here also.
602 599 .RE
603 600
604 601 .sp
605 602 .ne 2
606 603 .na
607 604 \fB\fBblank\fR\fR
608 605 .ad
609 606 .RS 18n
610 607 Define characters to be classified as blank characters.
611 608 .sp
612 609 In the POSIX locale, only the space and tab characters are included.
613 610 .sp
614 611 In a locale definition file, the characters space and tab are automatically
615 612 included in this class.
616 613 .RE
617 614
618 615 .sp
619 616 .ne 2
620 617 .na
621 618 \fB\fBcharclass\fR\fR
622 619 .ad
623 620 .RS 18n
624 621 Define one or more locale-specific character class names as strings separated
625 622 by semi-colons. Each named character class can then be defined subsequently in
626 623 the \fBLC_CTYPE\fR definition. A character class name consists of at least one
627 624 and at most \fB{CHARCLASS_NAME_MAX}\fR bytes of alphanumeric characters from
628 625 the portable filename character set. The first character of a character class
629 626 name cannot be a digit. The name cannot match any of the \fBLC_CTYPE\fR
630 627 keywords defined in this document.
631 628 .RE
632 629
633 630 .sp
634 631 .ne 2
635 632 .na
636 633 \fB\fBcharclass-name\fR\fR
637 634 .ad
638 635 .RS 18n
639 636 Define characters to be classified as belonging to the named locale-specific
640 637 character class. In the POSIX locale, the locale-specific named character
641 638 classes need not exist. If a class name is defined by a \fBcharclass\fR
642 639 keyword, but no characters are subsequently assigned to it, this is not an
643 640 error; it represents a class without any characters belonging to it. The
644 641 \fBcharclass-name\fR can be used as the \fIproperty\fR argument to the
645 642 \fBwctype\fR(3C) function, in regular expression and shell pattern-matching
646 643 bracket expressions, and by the \fBtr\fR(1) command.
647 644 .RE
648 645
649 646 .sp
650 647 .ne 2
651 648 .na
652 649 \fB\fBtoupper\fR\fR
653 650 .ad
654 651 .RS 18n
655 652 Define the mapping of lower-case letters to upper-case letters.
656 653 .sp
657 654 In the POSIX locale, at a minimum, the 26 lower-case characters:
658 655 .sp
659 656 .in +2
660 657 .nf
661 658 a b c d e f g h i j k l m n o p q r s t u v w x y z
662 659 .fi
663 660 .in -2
664 661 .sp
665 662
666 663 are mapped to the corresponding 26 upper-case characters:
667 664 .sp
668 665 .in +2
669 666 .nf
670 667 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
671 668 .fi
672 669 .in -2
673 670 .sp
674 671
675 672 In a locale definition file, the operand consists of character pairs, separated
676 673 by semicolons. The characters in each character pair are separated by a comma
677 674 and the pair enclosed by parentheses. The first character in each pair is the
678 675 lower-case letter, the second the corresponding upper-case letter. Only
679 676 characters specified for the keywords \fBlower\fR and \fBupper\fR can be
680 677 specified. The lower-case letters \fBa\fR to \fBz\fR, and their corresponding
681 678 upper-case letters \fBA\fR to \fBZ\fR, of the portable character set are
682 679 automatically included in this mapping, but only when the \fBtoupper\fR keyword
683 680 is omitted from the locale definition.
684 681 .RE
685 682
686 683 .sp
687 684 .ne 2
688 685 .na
689 686 \fB\fBtolower\fR\fR
690 687 .ad
691 688 .RS 18n
692 689 Define the mapping of upper-case letters to lower-case letters.
693 690 .sp
694 691 In the POSIX locale, at a minimum, the 26 upper-case characters:
695 692 .sp
696 693 .in +2
697 694 .nf
698 695 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
699 696 .fi
700 697 .in -2
701 698 .sp
702 699
703 700 are mapped to the corresponding 26 lower-case characters:
704 701 .sp
705 702 .in +2
706 703 .nf
707 704 a b c d e f g h i j k l m n o p q r s t u v w x y z
708 705 .fi
709 706 .in -2
710 707 .sp
711 708
↓ open down ↓ |
357 lines elided |
↑ open up ↑ |
712 709 In a locale definition file, the operand consists of character pairs, separated
713 710 by semicolons. The characters in each character pair are separated by a comma
714 711 and the pair enclosed by parentheses. The first character in each pair is the
715 712 upper-case letter, the second the corresponding lower-case letter. Only
716 713 characters specified for the keywords \fBlower\fR and \fBupper\fR can be
717 714 specified. If the \fBtolower\fR keyword is omitted from the locale definition,
718 715 the mapping will be the reverse mapping of the one specified for \fBtoupper\fR.
719 716 .RE
720 717
721 718 .SS "LC_COLLATE"
722 -.LP
723 719 The \fBLC_COLLATE\fR category provides a collation sequence definition for
724 720 numerous utilities (such as \fBsort\fR(1), \fBuniq\fR(1), and so forth),
725 721 regular expression matching (see \fBregex\fR(5)), and the \fBstrcoll\fR(3C),
726 722 \fBstrxfrm\fR(3C), \fBwcscoll\fR(3C), and \fBwcsxfrm\fR(3C) functions.
727 723 .sp
728 724 .LP
729 725 A collation sequence definition defines the relative order between collating
730 726 elements (characters and multi-character collating elements) in the locale.
731 727 This order is expressed in terms of collation values, that is, by assigning
732 728 each element one or more collation values (also known as collation weights).
733 729 The following capabilities are provided:
734 730 .RS +4
735 731 .TP
736 732 1.
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
737 733 \fBMulti-character collating elements\fR. Specification of multi-character
738 734 collating elements (that is, sequences of two or more characters to be collated
739 735 as an entity).
740 736 .RE
741 737 .RS +4
742 738 .TP
743 739 2.
744 740 \fBUser-defined ordering of collating elements\fR. Each collating element is
745 741 assigned a collation value defining its order in the character (or basic)
746 742 collation sequence. This ordering is used by regular expressions and pattern
747 -matching and, unless collation weights are explicity specified, also as the
743 +matching and, unless collation weights are explicitly specified, also as the
748 744 collation weight to be used in sorting.
749 745 .RE
750 746 .RS +4
751 747 .TP
752 748 3.
753 749 \fBMultiple weights and equivalence classes\fR. Collating elements can be
754 750 assigned one or more (up to the limit \fB{COLL_WEIGHTS_MAX}\fR \fB)\fR
755 751 collating weights for use in sorting. The first weight is hereafter referred to
756 752 as the primary weight.
757 753 .RE
758 754 .RS +4
759 755 .TP
760 756 4.
761 757 \fBOne-to-Many mapping\fR. A single character is mapped into a string of
762 758 collating elements.
763 759 .RE
764 760 .RS +4
765 761 .TP
766 762 5.
767 763 \fBEquivalence class definition\fR. Two or more collating elements have the
768 764 same collation value (primary weight).
769 765 .RE
770 766 .RS +4
771 767 .TP
772 768 6.
773 769 \fBOrdering by weights\fR. When two strings are compared to determine their
774 770 relative order, the two strings are first broken up into a series of collating
775 771 elements. The elements in each successive pair of elements are then compared
776 772 according to the relative primary weights for the elements. If equal, and more
777 773 than one weight has been assigned, the pairs of collating elements are
778 774 recompared according to the relative subsequent weights, until either a pair of
779 775 collating elements compare unequal or the weights are exhausted.
780 776 .RE
781 777 .sp
782 778 .LP
783 779 The following keywords are recognized in a collation sequence definition. They
784 780 are described in detail in the following sections.
785 781 .sp
786 782 .ne 2
787 783 .na
788 784 \fB\fBcopy\fR\fR
789 785 .ad
790 786 .RS 21n
791 787 Specify the name of an existing locale which is used as the definition of this
792 788 category. If this keyword is specified, no other keyword is specified.
793 789 .RE
794 790
795 791 .sp
796 792 .ne 2
797 793 .na
798 794 \fB\fBcollating-element\fR\fR
799 795 .ad
800 796 .RS 21n
801 797 Define a collating-element symbol representing a multi-character collating
802 798 element. This keyword is optional.
803 799 .RE
804 800
805 801 .sp
806 802 .ne 2
807 803 .na
808 804 \fB\fBcollating-symbol\fR\fR
809 805 .ad
810 806 .RS 21n
811 807 Define a collating symbol for use in collation order statements. This keyword
812 808 is optional.
813 809 .RE
814 810
815 811 .sp
816 812 .ne 2
817 813 .na
818 814 \fB\fBorder_start\fR\fR
819 815 .ad
820 816 .RS 21n
821 817 Define collation rules. This statement is followed by one or more collation
822 818 order statements, assigning character collation values and collation weights to
823 819 collating elements.
824 820 .RE
825 821
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
826 822 .sp
827 823 .ne 2
828 824 .na
829 825 \fB\fBorder_end\fR\fR
830 826 .ad
831 827 .RS 21n
832 828 Specify the end of the collation-order statements.
833 829 .RE
834 830
835 831 .SS "collating-element \fIkeyword\fR"
836 -.LP
837 832 In addition to the collating elements in the character set, the
838 833 \fBcollating-element\fR keyword is used to define multi-character collating
839 834 elements. The syntax is:
840 835 .sp
841 836 .in +2
842 837 .nf
843 838 \fB"collating-element %s from \e"%s\e"\en",\fR<\fIcollating-symbol\fR>,<\fIstring\fR>
844 839 .fi
845 840 .in -2
846 841
847 842 .sp
848 843 .LP
849 844 The <\fIcollating-symbol\fR> operand is a symbolic name, enclosed between angle
850 845 brackets (\fB<\fR and \fB>\fR), and must not duplicate any symbolic name in the
851 846 current charmap file (if any), or any other symbolic name defined in this
852 847 collation definition. The string operand is a string of two or more characters
853 848 that collates as an entity. A <\fIcollating-element\fR> defined via this
854 849 keyword is only recognized with the \fBLC_COLLATE\fR category.
855 850 .sp
856 851 .LP
857 852 Example:
858 853 .br
859 854 .in +2
860 855 \fBcollating-element\fR <\fBch\fR> from "<\fBc\fR><\fBh\fR>"
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
861 856 .in -2
862 857 .br
863 858 .in +2
864 859 \fBcollating-element\fR <\fBe-acute\fR> from "<\fBacute\fR><\fBe\fR>"
865 860 .in -2
866 861 .br
867 862 .in +2
868 863 \fBcollating-element\fR <\fBll\fR> from "\fBll\fR"
869 864 .in -2
870 865 .SS "collating-symbol \fIkeyword\fR"
871 -.LP
872 866 This keyword will be used to define symbols for use in collation sequence
873 867 statements; that is, between the \fBorder_start\fR and the \fBorder_end\fR
874 868 keywords. The syntax is:
875 869 .sp
876 870 .in +2
877 871 .nf
878 872 \fB"collating-symbol %s\en",\fR<\fIcollating-symbol\fR>
879 873 .fi
880 874 .in -2
881 875
882 876 .sp
883 877 .LP
884 878 The \fB<\fR\fIcollating-symbol\fR\fB>\fR is a symbolic name, enclosed between
885 879 angle brackets (\fB<\fR and \fB>\fR), and must not duplicate any symbolic name
886 880 in the current charmap file (if any), or any other symbolic name defined in
887 881 this collation definition.
888 882 .sp
889 883 .LP
890 884 A \fBcollating-symbol\fR defined via this keyword is only recognized with the
891 885 \fBLC_COLLATE\fR category.
892 886 .sp
893 887 .LP
894 888 Example:
895 889 .br
896 890 .in +2
897 891 \fBcollating-symbol\fR <\fBUPPER_CASE\fR>
898 892 .in -2
899 893 .br
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
900 894 .in +2
901 895 \fBcollating-symbol\fR <\fBHIGH\fR>
902 896 .in -2
903 897 .sp
904 898 .LP
905 899 The \fBcollating-symbol\fR keyword defines a symbolic name that can be
906 900 associated with a relative position in the character order sequence. While such
907 901 a symbolic name does not represent any collating element, it can be used as a
908 902 weight.
909 903 .SS "order_start \fIkeyword\fR"
910 -.LP
911 904 The \fBorder_start\fR keyword must precede collation order entries and also
912 905 defines the number of weights for this collation sequence definition and other
913 906 collation rules.
914 907 .sp
915 908 .LP
916 909 The syntax of the \fBorder_start\fR keyword is:
917 910 .sp
918 911 .in +2
919 912 .nf
920 913 \fB"order_start %s;%s;...;%s\en",\fR<\fIsort-rules\fR>,<\fIsort-rules\fR>
921 914 .fi
922 915 .in -2
923 916
924 917 .sp
925 918 .LP
926 919 The operands to the \fBorder_start\fR keyword are optional. If present, the
927 920 operands define rules to be applied when strings are compared. The number of
928 921 operands define how many weights each element is assigned. If no operands are
929 922 present, one \fBforward\fR operand is assumed. If present, the first operand
930 923 defines rules to be applied when comparing strings using the first (primary)
931 924 weight; the second when comparing strings using the second weight, and so on.
932 925 Operands are separated by semicolons (\fB;\fR). Each operand consists of one or
933 926 more collation directives, separated by commas (\fB,\fR). If the number of
934 927 operands exceeds the \fB{COLL_WEIGHTS_MAX}\fR limit, the utility will issue a
935 928 warning message. The following directives will be supported:
936 929 .sp
937 930 .ne 2
938 931 .na
939 932 \fB\fBforward\fR\fR
940 933 .ad
941 934 .RS 12n
942 935 Specifies that comparison operations for the weight level proceed from start of
943 936 string towards the end of string.
944 937 .RE
945 938
946 939 .sp
947 940 .ne 2
948 941 .na
949 942 \fB\fBbackward\fR\fR
950 943 .ad
951 944 .RS 12n
952 945 Specifies that comparison operations for the weight level proceed from end of
953 946 string towards the beginning of string.
954 947 .RE
955 948
956 949 .sp
957 950 .ne 2
958 951 .na
959 952 \fB\fBposition\fR\fR
960 953 .ad
961 954 .RS 12n
962 955 Specifies that comparison operations for the weight level will consider the
963 956 relative position of elements in the strings not subject to \fBIGNORE.\fR The
964 957 string containing an element not subject to \fBIGNORE\fR after the fewest
965 958 collating elements subject to \fBIGNORE\fR from the start of the compare will
966 959 collate first. If both strings contain a character not subject to \fBIGNORE\fR
967 960 in the same relative position, the collating values assigned to the elements
968 961 will determine the ordering. In case of equality, subsequent characters not
969 962 subject to \fBIGNORE\fR are considered in the same manner.
970 963 .RE
971 964
972 965 .sp
973 966 .LP
974 967 The directives \fBforward\fR and \fBbackward\fR are mutually exclusive.
975 968 .sp
976 969 .LP
977 970 Example:
978 971 .sp
979 972 .in +2
↓ open down ↓ |
59 lines elided |
↑ open up ↑ |
980 973 .nf
981 974 order_start forward;backward
982 975 .fi
983 976 .in -2
984 977 .sp
985 978
986 979 .sp
987 980 .LP
988 981 If no operands are specified, a single \fBforward\fR operand is assumed.
989 982 .SS "Collation Order"
990 -.LP
991 983 The \fBorder_start\fR keyword is followed by collating identifier entries. The
992 984 syntax for the collating element entries is:
993 985 .sp
994 986 .in +2
995 987 .nf
996 988 \fB"%s %s;%s;...;%s\en"\fR<\fIcollating-identifier\fR>,<\fIweight\fR>,<\fIweight\fR>\fB,...\fR
997 989 .fi
998 990 .in -2
999 991
1000 992 .sp
1001 993 .LP
1002 994 Each \fIcollating-identifier\fR consists of either a character described in
1003 995 \fBLocale Definition\fR above, a <\fIcollating-element\fR>, a
1004 996 <\fIcollating-symbol\fR>, an ellipsis, or the special symbol \fBUNDEFINED\fR.
1005 997 The order in which collating elements are specified determines the character
1006 998 order sequence, such that each collating element compares less than the
1007 999 elements following it. The \fBNUL\fR character compares lower than any other
1008 1000 character.
1009 1001 .sp
1010 1002 .LP
1011 1003 A <\fIcollating-element\fR> is used to specify multi-character collating
1012 1004 elements, and indicates that the character sequence specified via the
1013 1005 <\fIcollating-element\fR> is to be collated as a unit and in the relative order
1014 1006 specified by its place.
1015 1007 .sp
1016 1008 .LP
1017 1009 A <\fIcollating-symbol\fR> is used to define a position in the relative order
1018 1010 for use in weights. No weights are specified with a <\fIcollating-symbol\fR>.
1019 1011 .sp
1020 1012 .LP
1021 1013 The ellipsis symbol specifies that a sequence of characters will collate
1022 1014 according to their encoded character values. It is interpreted as indicating
1023 1015 that all characters with a coded character set value higher than the value of
1024 1016 the character in the preceding line, and lower than the coded character set
1025 1017 value for the character in the following line, in the current coded character
1026 1018 set, will be placed in the character collation order between the previous and
1027 1019 the following character in ascending order according to their coded character
1028 1020 set values. An initial ellipsis is interpreted as if the preceding line
1029 1021 specified the NUL character, and a trailing ellipsis as if the following line
1030 1022 specified the highest coded character set value in the current coded character
1031 1023 set. An ellipsis is treated as invalid if the preceding or following lines do
1032 1024 not specify characters in the current coded character set. The use of the
1033 1025 ellipsis symbol ties the definition to a specific coded character set and may
1034 1026 preclude the definition from being portable between implementations.
1035 1027 .sp
1036 1028 .LP
1037 1029 The symbol \fBUNDEFINED\fR is interpreted as including all coded character set
1038 1030 values not specified explicitly or via the ellipsis symbol. Such characters are
1039 1031 inserted in the character collation order at the point indicated by the symbol,
1040 1032 and in ascending order according to their coded character set values. If no
1041 1033 \fBUNDEFINED\fR symbol is specified, and the current coded character set
1042 1034 contains characters not specified in this section, the utility will issue a
1043 1035 warning message and place such characters at the end of the character collation
1044 1036 order.
1045 1037 .sp
1046 1038 .LP
1047 1039 The optional operands for each collation-element are used to define the
1048 1040 primary, secondary, or subsequent weights for the collating element. The first
1049 1041 operand specifies the relative primary weight, the second the relative
1050 1042 secondary weight, and so on. Two or more collation-elements can be assigned the
1051 1043 same weight; they belong to the same \fIequivalence class\fR if they have the
1052 1044 same primary weight. Collation behaves as if, for each weight level, elements
1053 1045 subject to \fBIGNORE\fR are removed, unless the \fBposition\fR collation
1054 1046 directive is specified for the corresponding level with the \fBorder_start\fR
1055 1047 keyword. Then each successive pair of elements is compared according to the
1056 1048 relative weights for the elements. If the two strings compare equal, the
1057 1049 process is repeated for the next weight level, up to the limit
1058 1050 {\fBCOLL_WEIGHTS_MAX\fR}.
1059 1051 .sp
1060 1052 .LP
1061 1053 Weights are expressed as characters described in \fBLocale Definition\fR
1062 1054 above, <\fIcollating-symbol\fR>s, <\fIcollating-element\fR>s, an ellipsis, or
1063 1055 the special symbol \fBIGNORE.\fR A single character, a <\fIcollating-symbol\fR>
1064 1056 or a <\fIcollating-element\fR> represent the relative position in the character
1065 1057 collating sequence of the character or symbol, rather than the character or
1066 1058 characters themselves. Thus, rather than assigning absolute values to weights,
1067 1059 a particular weight is expressed using the relative order value assigned to a
1068 1060 collating element based on its order in the character collation sequence.
1069 1061 .sp
1070 1062 .LP
1071 1063 One-to-many mapping is indicated by specifying two or more concatenated
1072 1064 characters or symbolic names. For example, if the character <\fBeszet\fR> is
1073 1065 given the string "<\fBs\fR><\fBs\fR>" as a weight, comparisons are performed as
1074 1066 if all occurrences of the character <\fBeszet\fR> are replaced by
1075 1067 <\fBs\fR><\fBs\fR> (assuming that <\fBs\fR> has the collating weight
1076 1068 <\fBs\fR>). If it is necessary to define <\fBeszet\fR> and <\fBs\fR><\fBs\fR>
1077 1069 as an equivalence class, then a collating element must be defined for the
1078 1070 string \fBss\fR.
1079 1071 .sp
1080 1072 .LP
1081 1073 All characters specified via an ellipsis will by default be assigned unique
1082 1074 weights, equal to the relative order of characters. Characters specified via an
1083 1075 explicit or implicit \fBUNDEFINED\fR special symbol will by default be assigned
1084 1076 the same primary weight (that is, belong to the same equivalence class). An
1085 1077 ellipsis symbol as a weight is interpreted to mean that each character in the
1086 1078 sequence has unique weights, equal to the relative order of their character in
1087 1079 the character collation sequence. The use of the ellipsis as a weight is
1088 1080 treated as an error if the collating element is neither an ellipsis nor the
1089 1081 special symbol \fBUNDEFINED\fR.
1090 1082 .sp
1091 1083 .LP
1092 1084 The special keyword \fBIGNORE\fR as a weight indicates that when strings are
1093 1085 compared using the weights at the level where \fBIGNORE\fR is specified, the
1094 1086 collating element is ignored; that is, as if the string did not contain the
1095 1087 collating element. In regular expressions and pattern matching, all characters
1096 1088 that are subject to \fBIGNORE\fR in their primary weight form an equivalence
1097 1089 class.
1098 1090 .sp
1099 1091 .LP
1100 1092 An empty operand is interpreted as the collating element itself.
1101 1093 .sp
1102 1094 .LP
1103 1095 For example, the order statement:
1104 1096 .sp
1105 1097 .in +2
1106 1098 .nf
1107 1099 <a> <a>;<a>
1108 1100 .fi
1109 1101 .in -2
1110 1102 .sp
1111 1103
1112 1104 .sp
1113 1105 .LP
1114 1106 is equal to:
1115 1107 .sp
1116 1108 .in +2
1117 1109 .nf
1118 1110 <a>
1119 1111 .fi
1120 1112 .in -2
1121 1113 .sp
1122 1114
1123 1115 .sp
1124 1116 .LP
1125 1117 An ellipsis can be used as an operand if the collating element was an ellipsis,
1126 1118 and is interpreted as the value of each character defined by the ellipsis.
1127 1119 .sp
1128 1120 .LP
1129 1121 The collation order as defined in this section defines the interpretation of
1130 1122 bracket expressions in regular expressions.
1131 1123 .sp
↓ open down ↓ |
131 lines elided |
↑ open up ↑ |
1132 1124 .LP
1133 1125 Example:
1134 1126 .sp
1135 1127
1136 1128 .sp
1137 1129 .TS
1138 1130 l l
1139 1131 l l .
1140 1132 \fBorder_start\fR \fBforward;backward\fR
1141 1133 \fBUNDEFINED\fR \fBIGNORE;IGNORE\fR
1142 -\fB<LOW>\fR
1134 +\fB<LOW>\fR
1143 1135 \fB<space>\fR \fB<LOW>;<space>\fR
1144 1136 \fB\&.\|.\|.\fR \fB<LOW>;.\|.\|.\fR
1145 1137 \fB<a>\fR \fB<a>;<a>\fR
1146 1138 \fB<a-acute>\fR \fB<a>;<a-acute>\fR
1147 1139 \fB<a-grave>\fR \fB<a>;<a-grave>\fR
1148 1140 \fB<A>\fR \fB<a>;<A>\fR
1149 1141 \fB<A-acute>\fR \fB<a>;<A-acute>\fR
1150 1142 \fB<A-grave>\fR \fB<a>;<A-grave>\fR
1151 1143 \fB<ch>\fR \fB<ch>;<ch>\fR
1152 1144 \fB<Ch>\fR \fB<ch>;<Ch>\fR
1153 1145 \fB<s>\fR \fB<s>;<s>\fR
1154 1146 \fB<eszet>\fR \fB"<s><s>";"<eszet><eszet>"\fR
1155 -\fBorder_end\fR
1147 +\fBorder_end\fR
1156 1148 .TE
1157 1149
1158 1150 .sp
1159 1151 .LP
1160 1152 This example is interpreted as follows:
1161 1153 .RS +4
1162 1154 .TP
1163 1155 1.
1164 1156 The \fBUNDEFINED\fR means that all characters not specified in this
1165 1157 definition (explicitly or via the ellipsis) are ignored for collation purposes;
1166 1158 for regular expression purposes they are ordered first.
1167 1159 .RE
1168 1160 .RS +4
1169 1161 .TP
1170 1162 2.
1171 1163 All characters between <\fBspace\fR> and <\fBa\fR> have the same primary
1172 1164 equivalence class and individual secondary weights based on their ordinal
1173 1165 encoded values.
1174 1166 .RE
1175 1167 .RS +4
1176 1168 .TP
1177 1169 3.
1178 1170 All characters based on the upper- or lower-case character \fBa\fR belong to
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
1179 1171 the same primary equivalence class.
1180 1172 .RE
1181 1173 .RS +4
1182 1174 .TP
1183 1175 4.
1184 1176 The multi-character collating element <\fBch\fR> is represented by the
1185 1177 collating symbol <\fBch\fR> and belongs to the same primary equivalence class
1186 1178 as the multi-character collating element <\fBCh\fR>.
1187 1179 .RE
1188 1180 .SS "order_end \fIkeyword\fR"
1189 -.LP
1190 1181 The collating order entries must be terminated with an \fBorder_end\fR keyword.
1191 1182 .SS "LC_MONETARY"
1192 -.LP
1193 1183 The \fBLC_MONETARY\fR category defines the rules and symbols that are used to
1194 1184 format monetary numeric information. This information is available through the
1195 1185 \fBlocaleconv\fR(3C) function
1196 1186 .sp
1197 1187 .LP
1198 1188 The following items are defined in this category of the locale. The item names
1199 1189 are the keywords recognized by the \fBlocaledef\fR(1) utility when defining a
1200 1190 locale. They are also similar to the member names of the \fBlconv\fR structure
1201 1191 defined in <\fBlocale.h\fR>. The \fBlocaleconv\fR function returns
1202 1192 \fB{CHAR_MAX}\fR for unspecified integer items and the empty string (\fB""\fR)
1203 1193 for unspecified or size zero string items.
1204 1194 .sp
1205 1195 .LP
1206 1196 In a locale definition file the operands are strings. For some keywords, the
1207 1197 strings can contain only integers. Keywords that are not provided, string
1208 1198 values set to the empty string (\fB""\fR), or integer keywords set to \fB-1\fR,
1209 1199 are used to indicate that the value is not available in the locale.
1210 1200 .sp
1211 1201 .ne 2
1212 1202 .na
1213 1203 \fB\fBint_curr_symbol\fR\fR
1214 1204 .ad
1215 1205 .RS 22n
1216 1206 The international currency symbol. The operand is a four-character string, with
1217 1207 the first three characters containing the alphabetic international currency
1218 1208 symbol in accordance with those specified in the ISO 4217 standard. The fourth
1219 1209 character is the character used to separate the international currency symbol
1220 1210 from the monetary quantity.
1221 1211 .RE
1222 1212
1223 1213 .sp
1224 1214 .ne 2
1225 1215 .na
1226 1216 \fB\fBcurrency_symbol\fR\fR
1227 1217 .ad
1228 1218 .RS 22n
1229 1219 The string used as the local currency symbol.
1230 1220 .RE
1231 1221
1232 1222 .sp
1233 1223 .ne 2
1234 1224 .na
1235 1225 \fB\fBmon_decimal_point\fR\fR
1236 1226 .ad
1237 1227 .RS 22n
1238 1228 The operand is a string containing the symbol that is used as the decimal
1239 1229 delimiter (radix character) in monetary formatted quantities.
1240 1230 .RE
1241 1231
1242 1232 .sp
1243 1233 .ne 2
1244 1234 .na
1245 1235 \fB\fBmon_thousands_sep\fR\fR
1246 1236 .ad
1247 1237 .RS 22n
1248 1238 The operand is a string containing the symbol that is used as a separator for
1249 1239 groups of digits to the left of the decimal delimiter in formatted monetary
1250 1240 quantities.
1251 1241 .RE
1252 1242
1253 1243 .sp
1254 1244 .ne 2
1255 1245 .na
1256 1246 \fB\fBmon_grouping\fR\fR
1257 1247 .ad
1258 1248 .RS 22n
1259 1249 Define the size of each group of digits in formatted monetary quantities. The
1260 1250 operand is a sequence of integers separated by semicolons. Each integer
1261 1251 specifies the number of digits in each group, with the initial integer defining
1262 1252 the size of the group immediately preceding the decimal delimiter, and the
1263 1253 following integers defining the preceding groups. If the last integer is not
1264 1254 \fB-1\fR, then the size of the previous group (if any) will be repeatedly used
1265 1255 for the remainder of the digits. If the last integer is \fB-1\fR, then no
1266 1256 further grouping will be performed.
1267 1257 .sp
1268 1258 The following is an example of the interpretation of the \fBmon_grouping\fR
1269 1259 keyword. Assuming that the value to be formatted is \fB123456789\fR and the
1270 1260 \fBmon_thousands_sep\fR is \fB\&'\fR, then the following table shows the
1271 1261 result. The third column shows the equivalent string in the ISO C standard that
1272 1262 would be used by the \fBlocaleconv\fR function to accommodate this grouping.
1273 1263 .sp
1274 1264 .in +2
1275 1265 .nf
1276 1266 mon_grouping Formatted Value ISO C String
1277 1267
1278 1268 3;-1 123456'789 "\e3\e177"
1279 1269 3 123'456'789 "\e3"
1280 1270 3;2;-1 1234'56'789 "\e3\e2\e177"
1281 1271 3;2 12'34'56'789 "\e3\e2"
1282 1272 -1 1234567898 "\e177"
1283 1273 .fi
1284 1274 .in -2
1285 1275 .sp
1286 1276
1287 1277 In these examples, the octal value of \fB{CHAR_MAX}\fR is 177.
1288 1278 .RE
1289 1279
1290 1280 .sp
1291 1281 .ne 2
1292 1282 .na
1293 1283 \fB\fBpositive_sign\fR\fR
1294 1284 .ad
1295 1285 .RS 22n
1296 1286 A string used to indicate a non-negative-valued formatted monetary quantity.
1297 1287 .RE
1298 1288
1299 1289 .sp
1300 1290 .ne 2
1301 1291 .na
1302 1292 \fB\fBnegative_sign\fR\fR
1303 1293 .ad
1304 1294 .RS 22n
1305 1295 A string used to indicate a negative-valued formatted monetary quantity.
1306 1296 .RE
1307 1297
1308 1298 .sp
1309 1299 .ne 2
1310 1300 .na
1311 1301 \fB\fBint_frac_digits\fR\fR
1312 1302 .ad
1313 1303 .RS 22n
1314 1304 An integer representing the number of fractional digits (those to the right of
1315 1305 the decimal delimiter) to be written in a formatted monetary quantity using
1316 1306 \fBint_curr_symbol\fR.
1317 1307 .RE
1318 1308
1319 1309 .sp
1320 1310 .ne 2
1321 1311 .na
1322 1312 \fB\fBfrac_digits\fR\fR
1323 1313 .ad
1324 1314 .RS 22n
1325 1315 An integer representing the number of fractional digits (those to the right of
1326 1316 the decimal delimiter) to be written in a formatted monetary quantity using
1327 1317 \fBcurrency_symbol\fR.
1328 1318 .RE
1329 1319
1330 1320 .sp
1331 1321 .ne 2
1332 1322 .na
1333 1323 \fB\fBp_cs_precedes\fR\fR
1334 1324 .ad
1335 1325 .RS 22n
1336 1326 In an application conforming to the SUSv3 standard, an integer set to \fB1\fR
1337 1327 if the \fBcurrency_symbol\fR precedes the value for a monetary quantity with a
1338 1328 non-negative value, and set to \fB0\fR if the symbol succeeds the value.
1339 1329 .sp
1340 1330 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1341 1331 \fB1\fR if the \fBcurrency_symbol\fR or \fBint_currency_symbol\fR precedes the
1342 1332 value for a monetary quantity with a non-negative value, and set to \fB0\fR if
1343 1333 the symbol succeeds the value.
1344 1334 .RE
1345 1335
1346 1336 .sp
1347 1337 .ne 2
1348 1338 .na
1349 1339 \fB\fBp_sep_by_space\fR\fR
1350 1340 .ad
1351 1341 .RS 22n
1352 1342 In an application conforming to the SUSv3 standard, an integer set to \fB0\fR
1353 1343 if no space separates the \fBcurrency_symbol\fR from the value for a monetary
1354 1344 quantity with a non-negative value, set to \fB1\fR if a space separates the
1355 1345 symbol from the value, and set to \fB2\fR if a space separates the symbol and
1356 1346 the sign string, if adjacent.
1357 1347 .sp
1358 1348 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1359 1349 \fB0\fR if no space separates the \fBcurrency_symbol\fR or
1360 1350 \fBint_curr_symbol\fR from the value for a monetary quantity with a
1361 1351 non-negative value, set to \fB1\fR if a space separates the symbol from the
1362 1352 value, and set to \fB2\fR if a space separates the symbol and the sign string,
1363 1353 if adjacent.
1364 1354 .RE
1365 1355
1366 1356 .sp
1367 1357 .ne 2
1368 1358 .na
1369 1359 \fB\fBn_cs_precedes\fR\fR
1370 1360 .ad
1371 1361 .RS 22n
1372 1362 In an application conforming to the SUSv3 standard, an integer set to \fB1\fR
1373 1363 if the \fBcurrency_symbol\fR precedes the value for a monetary quantity with a
1374 1364 negative value, and set to \fB0\fR if the symbol succeeds the value.
1375 1365 .sp
1376 1366 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1377 1367 \fB1\fR if the \fBcurrency_symbol\fR or \fBint_currency_symbol\fR precedes the
1378 1368 value for a monetary quantity with a negative value, and set to \fB0\fR if the
1379 1369 symbol succeeds the value.
1380 1370 .RE
1381 1371
1382 1372 .sp
1383 1373 .ne 2
1384 1374 .na
1385 1375 \fB\fBn_sep_by_space\fR\fR
1386 1376 .ad
1387 1377 .RS 22n
1388 1378 In an application conforming to the SUSv3 standard, an integer set to \fB0\fR
1389 1379 if no space separates the \fBcurrency_symbol\fR from the value for a monetary
1390 1380 quantity with a negative value, set to \fB1\fR if a space separates the symbol
1391 1381 from the value, and set to \fB2\fR if a space separates the symbol and the sign
1392 1382 string, if adjacent.
1393 1383 .sp
1394 1384 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1395 1385 \fB0\fR if no space separates the \fBcurrency_symbol\fR or
1396 1386 \fBint_curr_symbol\fR from the value for a monetary quantity with a negative
1397 1387 value, set to \fB1\fR if a space separates the symbol from the value, and set
1398 1388 to \fB2\fR if a space separates the symbol and the sign string, if adjacent.
1399 1389 .RE
1400 1390
1401 1391 .sp
1402 1392 .ne 2
1403 1393 .na
1404 1394 \fB\fBp_sign_posn\fR\fR
1405 1395 .ad
1406 1396 .RS 22n
1407 1397 An integer set to a value indicating the positioning of the \fBpositive_sign\fR
1408 1398 for a monetary quantity with a non-negative value. The following integer values
1409 1399 are recognized for both \fBp_sign_posn\fR and \fBn_sign_posn\fR:
1410 1400 .sp
1411 1401 In an application conforming to the SUSv3 standard:
1412 1402 .sp
1413 1403 .ne 2
1414 1404 .na
1415 1405 \fB\fB0\fR\fR
1416 1406 .ad
1417 1407 .RS 5n
1418 1408 Parentheses enclose the quantity and the \fBcurrency_symbol\fR.
1419 1409 .RE
1420 1410
1421 1411 .sp
1422 1412 .ne 2
1423 1413 .na
1424 1414 \fB\fB1\fR\fR
1425 1415 .ad
1426 1416 .RS 5n
1427 1417 The sign string precedes the quantity and the \fBcurrency_symbol\fR.
1428 1418 .RE
1429 1419
1430 1420 .sp
1431 1421 .ne 2
1432 1422 .na
1433 1423 \fB\fB2\fR\fR
1434 1424 .ad
1435 1425 .RS 5n
1436 1426 The sign string succeeds the quantity and the \fBcurrency_symbol\fR.
1437 1427 .RE
1438 1428
1439 1429 .sp
1440 1430 .ne 2
1441 1431 .na
1442 1432 \fB\fB3\fR\fR
1443 1433 .ad
1444 1434 .RS 5n
1445 1435 The sign string precedes the \fBcurrency_symbol\fR.
1446 1436 .RE
1447 1437
1448 1438 .sp
1449 1439 .ne 2
1450 1440 .na
1451 1441 \fB\fB4\fR\fR
1452 1442 .ad
1453 1443 .RS 5n
1454 1444 The sign string succeeds the \fBcurrency_symbol\fR.
1455 1445 .RE
1456 1446
1457 1447 In an application \fBnot\fR conforming to the SUSv3 standard:
1458 1448 .sp
1459 1449 .ne 2
1460 1450 .na
1461 1451 \fB\fB0\fR\fR
1462 1452 .ad
1463 1453 .RS 5n
1464 1454 Parentheses enclose the quantity and the \fBcurrency_symbol\fR or
1465 1455 \fBint_curr_symbol\fR.
1466 1456 .RE
1467 1457
1468 1458 .sp
1469 1459 .ne 2
1470 1460 .na
1471 1461 \fB\fB1\fR\fR
1472 1462 .ad
1473 1463 .RS 5n
1474 1464 The sign string precedes the quantity and the \fBcurrency_symbol\fR or
1475 1465 \fBint_curr_symbol\fR.
1476 1466 .RE
1477 1467
1478 1468 .sp
1479 1469 .ne 2
1480 1470 .na
1481 1471 \fB\fB2\fR\fR
1482 1472 .ad
1483 1473 .RS 5n
1484 1474 The sign string succeeds the quantity and the \fBcurrency_symbol\fR or
1485 1475 \fBint_curr_symbol\fR.
1486 1476 .RE
1487 1477
1488 1478 .sp
1489 1479 .ne 2
1490 1480 .na
1491 1481 \fB\fB3\fR\fR
1492 1482 .ad
1493 1483 .RS 5n
1494 1484 The sign string precedes the \fBcurrency_symbol\fR or \fBint_curr_symbol\fR.
1495 1485 .RE
1496 1486
1497 1487 .sp
1498 1488 .ne 2
1499 1489 .na
1500 1490 \fB\fB4\fR\fR
1501 1491 .ad
1502 1492 .RS 5n
1503 1493 The sign string succeeds the \fBcurrency_symbol\fR or \fBint_curr_symbol\fR.
1504 1494 .RE
1505 1495
1506 1496 .RE
1507 1497
1508 1498 .sp
1509 1499 .ne 2
1510 1500 .na
1511 1501 \fB\fBn_sign_posn\fR\fR
1512 1502 .ad
1513 1503 .RS 22n
1514 1504 An integer set to a value indicating the positioning of the \fBnegative_sign\fR
1515 1505 for a negative formatted monetary quantity.
1516 1506 .RE
1517 1507
1518 1508 .sp
1519 1509 .ne 2
1520 1510 .na
1521 1511 \fB\fBint_p_cs_precedes\fR\fR
1522 1512 .ad
1523 1513 .RS 22n
1524 1514 An integer set to \fB1\fR if the \fBint_curr_symbol\fR precedes the value for a
1525 1515 monetary quantity with a non-negative value, and set to \fB0\fR if the symbol
1526 1516 succeeds the value.
1527 1517 .RE
1528 1518
1529 1519 .sp
1530 1520 .ne 2
1531 1521 .na
1532 1522 \fB\fBint_n_cs_precedes\fR\fR
1533 1523 .ad
1534 1524 .RS 22n
1535 1525 An integer set to \fB1\fR if the \fBint_curr_symbol\fR precedes the value for a
1536 1526 monetary quantity with a negative value, and set to \fB0\fR if the symbol
1537 1527 succeeds the value.
1538 1528 .RE
1539 1529
1540 1530 .sp
1541 1531 .ne 2
1542 1532 .na
1543 1533 \fB\fBint_p_sep_by_space\fR\fR
1544 1534 .ad
1545 1535 .RS 22n
1546 1536 An integer set to \fB0\fR if no space separates the \fBint_curr_symbol\fR from
1547 1537 the value for a monetary quantity with a non-negative value, set to \fB1\fR if
1548 1538 a space separates the symbol from the value, and set to \fB2\fR if a space
1549 1539 separates the symbol and the sign string, if adjacent.
1550 1540 .RE
1551 1541
1552 1542 .sp
1553 1543 .ne 2
1554 1544 .na
1555 1545 \fB\fBint_n_sep_by_space\fR\fR
1556 1546 .ad
1557 1547 .RS 22n
1558 1548 An integer set to \fB0\fR if no space separates the \fBint_curr_symbol\fR from
1559 1549 the value for a monetary quantity with a negative value, set to \fB1\fR if a
1560 1550 space separates the symbol from the value, and set to \fB2\fR if a space
1561 1551 separates the symbol and the sign string, if adjacent.
1562 1552 .RE
1563 1553
1564 1554 .sp
1565 1555 .ne 2
1566 1556 .na
1567 1557 \fB\fBint_p_sign_posn\fR\fR
1568 1558 .ad
1569 1559 .RS 22n
1570 1560 An integer set to a value indicating the positioning of the \fBpositive_sign\fR
1571 1561 for a positive monetary quantity formatted with the international format. The
1572 1562 following integer values are recognized for \fBint_p_sign_posn\fR and
1573 1563 \fBint_n_sign_posn\fR:
1574 1564 .sp
1575 1565 .ne 2
1576 1566 .na
1577 1567 \fB\fB0\fR\fR
1578 1568 .ad
1579 1569 .RS 5n
1580 1570 Parentheses enclose the quantity and the \fB\fR\fBint_curr_symbol\fR.
1581 1571 .RE
1582 1572
1583 1573 .sp
1584 1574 .ne 2
1585 1575 .na
1586 1576 \fB\fB1\fR\fR
1587 1577 .ad
1588 1578 .RS 5n
1589 1579 The sign string precedes the quantity and the \fBint_curr_symbol\fR.
1590 1580 .RE
1591 1581
1592 1582 .sp
1593 1583 .ne 2
1594 1584 .na
1595 1585 \fB\fB2\fR\fR
1596 1586 .ad
1597 1587 .RS 5n
1598 1588 The sign string precedes the quantity and the \fBint_curr_symbol\fR.
1599 1589 .RE
1600 1590
1601 1591 .sp
1602 1592 .ne 2
1603 1593 .na
1604 1594 \fB\fB3\fR\fR
1605 1595 .ad
1606 1596 .RS 5n
1607 1597 The sign string precedes the \fBint_curr_symbol\fR.
1608 1598 .RE
1609 1599
1610 1600 .sp
1611 1601 .ne 2
1612 1602 .na
1613 1603 \fB\fB4\fR\fR
1614 1604 .ad
1615 1605 .RS 5n
1616 1606 The sign string succeeds the \fBint_curr_symbol\fR.
1617 1607 .RE
1618 1608
1619 1609 .RE
1620 1610
1621 1611 .sp
1622 1612 .ne 2
1623 1613 .na
1624 1614 \fB\fBint_n_sign_posn\fR\fR
1625 1615 .ad
1626 1616 .RS 22n
1627 1617 An integer set to a value indicating the positioning of the \fBnegative_sign\fR
1628 1618 for a negative monetary quantity formatted with the international format.
1629 1619 .RE
↓ open down ↓ |
427 lines elided |
↑ open up ↑ |
1630 1620
1631 1621 .sp
1632 1622 .LP
1633 1623 The following table shows the result of various combinations:
1634 1624 .sp
1635 1625
1636 1626 .sp
1637 1627 .TS
1638 1628 l l l l l l
1639 1629 l l l l l l .
1640 - \fBp_sep_by_space\fR
1641 - 2 1 0
1642 -\fBp_cs_precedes\fR= 1 \fBp_sign_posn\fR= 0 \fB($1.25)\fR \fB($1.25)\fR \fB($1.25)\fR
1643 - \fBp_sign_posn\fR= 1 \fB+$1.25\fR \fB+$1.25\fR \fB+$1.25\fR
1644 - \fBp_sign_posn\fR= 2 \fB$1.25+\fR \fB$1.25+\fR \fB$1.25+\fR
1645 - \fBp_sign_posn\fR= 3 \fB+$1.25\fR \fB+$1.25\fR \fB+$1.25\fR
1646 - \fBp_sign_posn\fR= 4 \fB$+1.25\fR \fB$+1.25\fR \fB$+1.25\fR
1647 -\fBp_cs_precedes\fR= 0 \fBp_sign_posn\fR= 0 \fB(1.25 $)\fR \fB(1.25 $)\fR \fB(1.25$)\fR
1648 - \fBp_sign_posn\fR= 1 \fB+1.25 $\fR \fB+1.25 $\fR \fB+1.25$\fR
1649 - \fBp_sign_posn\fR= 2 \fB1.25$ +\fR \fB1.25 $+\fR \fB1.25$+\fR
1650 - \fBp_sign_posn\fR= 3 \fB1.25+ $\fR \fB1.25 +$\fR \fB1.25+$\fR
1651 - \fBp_sign_posn\fR= 4 \fB1.25$ +\fR \fB1.25 $+\fR \fB1.25$+\fR
1630 + \fBp_sep_by_space\fR
1631 + 2 1 0
1632 +\fBp_cs_precedes\fR= 1 \fBp_sign_posn\fR= 0 \fB($1.25)\fR \fB($1.25)\fR \fB($1.25)\fR
1633 + \fBp_sign_posn\fR= 1 \fB+$1.25\fR \fB+$1.25\fR \fB+$1.25\fR
1634 + \fBp_sign_posn\fR= 2 \fB$1.25+\fR \fB$1.25+\fR \fB$1.25+\fR
1635 + \fBp_sign_posn\fR= 3 \fB+$1.25\fR \fB+$1.25\fR \fB+$1.25\fR
1636 + \fBp_sign_posn\fR= 4 \fB$+1.25\fR \fB$+1.25\fR \fB$+1.25\fR
1637 +\fBp_cs_precedes\fR= 0 \fBp_sign_posn\fR= 0 \fB(1.25 $)\fR \fB(1.25 $)\fR \fB(1.25$)\fR
1638 + \fBp_sign_posn\fR= 1 \fB+1.25 $\fR \fB+1.25 $\fR \fB+1.25$\fR
1639 + \fBp_sign_posn\fR= 2 \fB1.25$ +\fR \fB1.25 $+\fR \fB1.25$+\fR
1640 + \fBp_sign_posn\fR= 3 \fB1.25+ $\fR \fB1.25 +$\fR \fB1.25+$\fR
1641 + \fBp_sign_posn\fR= 4 \fB1.25$ +\fR \fB1.25 $+\fR \fB1.25$+\fR
1652 1642 .TE
1653 1643
1654 1644 .sp
1655 1645 .LP
1656 1646 The monetary formatting definitions for the POSIX locale follow. The code
1657 1647 listing depicts the \fBlocaledef\fR(1) input, the table representing the same
1658 1648 information with the addition of \fBlocaleconv\fR(3C) and \fBnl_langinfo\fR(3C)
1659 1649 formats. All values are unspecified in the POSIX locale.
1660 1650 .sp
1661 1651 .in +2
1662 1652 .nf
1663 1653 LC_MONETARY
1664 1654 # This is the POSIX locale definition for
1665 1655 # the LC_MONETARY category.
1666 1656 #
1667 1657 int_curr_symbol ""
1668 1658 currency_symbol ""
1669 1659 mon_decimal_point ""
1670 1660 mon_thousands_sep ""
1671 1661 mon_grouping -1
1672 1662 positive_sign ""
1673 1663 negative_sign ""
1674 1664 int_frac_digits -1
1675 1665 frac_digits -1
1676 1666 p_cs_precedes -1
1677 1667 p_sep_by_space -1
1678 1668 n_cs_precedes -1
1679 1669 n_sep_by_space -1
1680 1670 p_sign_posn -1
1681 1671 n_sign_posn -1
1682 1672 int_p_cs_precedes -1
1683 1673 int_p_sep_by_space -1
1684 1674 int_n_cs_precedes -1
1685 1675 int_n_sep_by_space -1
1686 1676 int_p_sign_posn -1
1687 1677 int_n_sign_posn -1
1688 1678 #
↓ open down ↓ |
27 lines elided |
↑ open up ↑ |
1689 1679 END LC_MONETARY
1690 1680 .fi
1691 1681 .in -2
1692 1682 .sp
1693 1683
1694 1684 .sp
1695 1685 .LP
1696 1686 The entry \fBn/a\fR indicates that the value is not available in the POSIX
1697 1687 locale.
1698 1688 .SS "LC_NUMERIC"
1699 -.LP
1700 1689 The \fBLC_NUMERIC\fR category defines the rules and symbols that will be used
1701 1690 to format non-monetary numeric information. This information is available
1702 1691 through the \fBlocaleconv\fR(3C) function.
1703 1692 .sp
1704 1693 .LP
1705 1694 The following items are defined in this category of the locale. The item names
1706 1695 are the keywords recognized by the \fBlocaledef\fR utility when defining a
1707 1696 locale. They are also similar to the member names of the \fIlconv\fR structure
1708 1697 defined in <\fBlocale.h\fR>. The \fBlocaleconv()\fR function returns
1709 1698 \fB{CHAR_MAX}\fR for unspecified integer items and the empty string (\fB""\fR)
1710 1699 for unspecified or size zero string items.
1711 1700 .sp
1712 1701 .LP
1713 1702 In a locale definition file the operands are strings. For some keywords, the
1714 1703 strings only can contain integers. Keywords that are not provided, string
1715 1704 values set to the empty string (\fB""\fR), or integer keywords set to \fB-1\fR,
1716 1705 will be used to indicate that the value is not available in the locale. The
1717 1706 following keywords are recognized:
1718 1707 .sp
1719 1708 .ne 2
1720 1709 .na
1721 1710 \fB\fBdecimal_point\fR\fR
1722 1711 .ad
1723 1712 .RS 17n
1724 1713 The operand is a string containing the symbol that is used as the decimal
1725 1714 delimiter (radix character) in numeric, non-monetary formatted quantities. This
1726 1715 keyword cannot be omitted and cannot be set to the empty string. In contexts
1727 1716 where standards limit the \fBdecimal_point\fR to a single byte, the result of
1728 1717 specifying a multi-byte operand is unspecified.
1729 1718 .RE
1730 1719
1731 1720 .sp
1732 1721 .ne 2
1733 1722 .na
1734 1723 \fB\fBthousands_sep\fR\fR
1735 1724 .ad
1736 1725 .RS 17n
1737 1726 The operand is a string containing the symbol that is used as a separator for
1738 1727 groups of digits to the left of the decimal delimiter in numeric, non-monetary
1739 1728 formatted monetary quantities. In contexts where standards limit the
1740 1729 \fBthousands_sep\fR to a single byte, the result of specifying a multi-byte
1741 1730 operand is unspecified.
1742 1731 .RE
1743 1732
1744 1733 .sp
1745 1734 .ne 2
1746 1735 .na
1747 1736 \fB\fBgrouping\fR\fR
1748 1737 .ad
1749 1738 .RS 17n
1750 1739 Define the size of each group of digits in formatted non-monetary quantities.
1751 1740 The operand is a sequence of integers separated by semicolons. Each integer
1752 1741 specifies the number of digits in each group, with the initial integer defining
1753 1742 the size of the group immediately preceding the decimal delimiter, and the
1754 1743 following integers defining the preceding groups. If the last integer is not
1755 1744 \fB\(mi1\fR, then the size of the previous group (if any) will be repeatedly
1756 1745 used for the remainder of the digits. If the last integer is \fB-1\fR, then no
1757 1746 further grouping will be performed. The non-monetary numeric formatting
1758 1747 definitions for the POSIX locale follow. The code listing depicts the
1759 1748 \fBlocaledef\fR input, the table representing the same information with the
1760 1749 addition of \fBlocaleconv\fR values, and \fBnl_langinfo\fR constants.
1761 1750 .sp
1762 1751 .in +2
1763 1752 .nf
1764 1753 LC_NUMERIC
1765 1754 # This is the POSIX locale definition for
1766 1755 # the LC_NUMERIC category.
1767 1756 #
1768 1757 decimal_point "<period>"
1769 1758 thousands_sep ""
1770 1759 grouping -1
1771 1760 #
1772 1761 END LC_NUMERIC
1773 1762 .fi
1774 1763 .in -2
1775 1764 .sp
1776 1765
1777 1766 .RE
1778 1767
1779 1768 .sp
1780 1769
1781 1770 .sp
1782 1771 .TS
1783 1772 l l l l l
1784 1773 l l l l l .
1785 1774 \fBPOSIX locale\fR \fBlanginfo\fR \fBlocaleconv()\fR \fBlocaledef\fR
1786 1775 \fBItem\fR \fBValue\fR \fBConstant\fR \fBValue\fR \fBValue\fR
1787 1776 _
↓ open down ↓ |
78 lines elided |
↑ open up ↑ |
1788 1777 \fBdecimal_point\fR \fB"."\fR \fBRADIXCHAR\fR \fB"."\fR \fB\&.\fR
1789 1778 \fBthousands_sep\fR \fBn/a\fR \fBTHOUSEP\fR \fB""\fR \fB""\fR
1790 1779 \fBgrouping\fR \fBn/a\fR \fB-\fR \fB""\fR \fB\(mi1\fR
1791 1780 .TE
1792 1781
1793 1782 .sp
1794 1783 .LP
1795 1784 The entry \fBn/a\fR indicates that the value is not available in the POSIX
1796 1785 locale.
1797 1786 .SS "LC_TIME"
1798 -.LP
1799 1787 The \fBLC_TIME\fR category defines the interpretation of the field descriptors
1800 1788 supported by \fBdate\fR(1) and affects the behavior of the \fBstrftime\fR(3C),
1801 1789 \fBwcsftime\fR(3C), \fBstrptime\fR(3C), and \fBnl_langinfo\fR(3C) functions.
1802 1790 Because the interfaces for C-language access and locale definition differ
1803 1791 significantly, they are described separately. For locale definition, the
1804 1792 following mandatory keywords are recognized:
1805 1793 .sp
1806 1794 .ne 2
1807 1795 .na
1808 1796 \fB\fBabday\fR\fR
1809 1797 .ad
1810 1798 .RS 15n
1811 1799 Define the abbreviated weekday names, corresponding to the \fB%a\fR field
1812 1800 descriptor (conversion specification in the \fBstrftime()\fR, \fBwcsftime()\fR,
1813 1801 and \fBstrptime()\fR functions). The operand consists of seven
1814 1802 semicolon-separated strings, each surrounded by double-quotes. The first string
1815 1803 is the abbreviated name of the day corresponding to Sunday, the second the
1816 1804 abbreviated name of the day corresponding to Monday, and so on.
1817 1805 .RE
1818 1806
1819 1807 .sp
1820 1808 .ne 2
1821 1809 .na
1822 1810 \fB\fBday\fR\fR
1823 1811 .ad
1824 1812 .RS 15n
1825 1813 Define the full weekday names, corresponding to the \fB%A\fR field descriptor.
1826 1814 The operand consists of seven semicolon-separated strings, each surrounded by
1827 1815 double-quotes. The first string is the full name of the day corresponding to
1828 1816 Sunday, the second the full name of the day corresponding to Monday, and so on.
1829 1817 .RE
1830 1818
1831 1819 .sp
1832 1820 .ne 2
1833 1821 .na
1834 1822 \fB\fBabmon\fR\fR
1835 1823 .ad
1836 1824 .RS 15n
1837 1825 Define the abbreviated month names, corresponding to the \fB%b\fR field
1838 1826 descriptor. The operand consists of twelve semicolon-separated strings, each
1839 1827 surrounded by double-quotes. The first string is the abbreviated name of the
1840 1828 first month of the year (January), the second the abbreviated name of the
1841 1829 second month, and so on.
1842 1830 .RE
1843 1831
1844 1832 .sp
1845 1833 .ne 2
1846 1834 .na
1847 1835 \fB\fBmon\fR\fR
1848 1836 .ad
1849 1837 .RS 15n
1850 1838 Define the full month names, corresponding to the \fB%B\fR field descriptor.
1851 1839 The operand consists of twelve semicolon-separated strings, each surrounded by
1852 1840 double-quotes. The first string is the full name of the first month of the year
1853 1841 (January), the second the full name of the second month, and so on.
1854 1842 .RE
1855 1843
1856 1844 .sp
1857 1845 .ne 2
1858 1846 .na
1859 1847 \fB\fBd_t_fmt\fR\fR
1860 1848 .ad
1861 1849 .RS 15n
1862 1850 Define the appropriate date and time representation, corresponding to the
1863 1851 \fB%c\fR field descriptor. The operand consists of a string, and can contain
1864 1852 any combination of characters and field descriptors. In addition, the string
1865 1853 can contain the escape sequences \e\e, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR,
1866 1854 \fB\en\fR, \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1867 1855 .RE
1868 1856
1869 1857 .sp
1870 1858 .ne 2
1871 1859 .na
1872 1860 \fB\fBdate_fmt\fR\fR
1873 1861 .ad
1874 1862 .RS 15n
1875 1863 Define the appropriate date and time representation, corresponding to the
1876 1864 \fB%C\fR field descriptor. The operand consists of a string, and can contain
1877 1865 any combination of characters and field descriptors. In addition, the string
1878 1866 can contain the escape sequences \fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR,
1879 1867 \fB\en\fR, \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1880 1868 .RE
1881 1869
1882 1870 .sp
1883 1871 .ne 2
1884 1872 .na
1885 1873 \fB\fBd_fmt\fR\fR
1886 1874 .ad
1887 1875 .RS 15n
1888 1876 Define the appropriate date representation, corresponding to the \fB%x\fR field
1889 1877 descriptor. The operand consists of a string, and can contain any combination
1890 1878 of characters and field descriptors. In addition, the string can contain the
1891 1879 escape sequences \fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR,
1892 1880 \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1893 1881 .RE
1894 1882
1895 1883 .sp
1896 1884 .ne 2
1897 1885 .na
1898 1886 \fB\fBt_fmt\fR\fR
1899 1887 .ad
1900 1888 .RS 15n
1901 1889 Define the appropriate time representation, corresponding to the \fB%X\fR field
1902 1890 descriptor. The operand consists of a string, and can contain any combination
1903 1891 of characters and field descriptors. In addition, the string can contain the
1904 1892 escape sequences \fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR,
1905 1893 \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1906 1894 .RE
1907 1895
1908 1896 .sp
1909 1897 .ne 2
1910 1898 .na
1911 1899 \fB\fBam_pm\fR\fR
1912 1900 .ad
1913 1901 .RS 15n
1914 1902 Define the appropriate representation of the \fIante meridiem\fR and \fIpost
1915 1903 meridiem\fR strings, corresponding to the \fB%p\fR field descriptor. The
1916 1904 operand consists of two strings, separated by a semicolon, each surrounded by
1917 1905 double-quotes. The first string represents the \fIante meridiem\fR designation,
1918 1906 the last string the \fIpost meridiem\fR designation.
1919 1907 .RE
1920 1908
1921 1909 .sp
1922 1910 .ne 2
1923 1911 .na
1924 1912 \fB\fBt_fmt_ampm\fR\fR
1925 1913 .ad
1926 1914 .RS 15n
1927 1915 Define the appropriate time representation in the 12-hour clock format with
1928 1916 \fBam_pm\fR, corresponding to the \fB%r\fR field descriptor. The operand
1929 1917 consists of a string and can contain any combination of characters and field
1930 1918 descriptors. If the string is empty, the 12-hour format is not supported in the
1931 1919 locale.
1932 1920 .RE
1933 1921
1934 1922 .sp
1935 1923 .ne 2
1936 1924 .na
1937 1925 \fB\fBera\fR\fR
1938 1926 .ad
1939 1927 .RS 15n
1940 1928 Define how years are counted and displayed for each era in a locale. The
1941 1929 operand consists of semicolon-separated strings. Each string is an era
1942 1930 description segment with the format:
1943 1931 .sp
1944 1932 \fIdirection\fR:\fIoffset\fR:\fIstart_date\fR:\fIend_date\fR:\fIera_name\fR:\fIera_format\fR
1945 1933 .sp
1946 1934 according to the definitions below. There can be as many era description
1947 1935 segments as are necessary to describe the different eras.
1948 1936 .sp
1949 1937 The start of an era might not be the earliest point For example, the Christian
1950 1938 era B.C. starts on the day before January 1, A.D. 1, and increases with earlier
1951 1939 time.
1952 1940 .sp
1953 1941 .ne 2
1954 1942 .na
1955 1943 \fB\fIdirection\fR\fR
1956 1944 .ad
1957 1945 .RS 14n
1958 1946 Either a \fB+\fR or a \fB-\fR character. The \fB+\fR character indicates that
1959 1947 years closer to the \fIstart_date\fR have lower numbers than those closer to
1960 1948 the \fIend_date\fR. The \fB-\fR character indicates that years closer to the
1961 1949 \fIstart_date\fR have higher numbers than those closer to the \fIend_date\fR.
1962 1950 .RE
1963 1951
1964 1952 .sp
1965 1953 .ne 2
1966 1954 .na
1967 1955 \fB\fIoffset\fR\fR
1968 1956 .ad
1969 1957 .RS 14n
1970 1958 The number of the year closest to the \fIstart_date\fR in the era,
1971 1959 corresponding to the \fB%Eg\fR and \fB%Ey\fR field descriptors.
1972 1960 .RE
1973 1961
1974 1962 .sp
1975 1963 .ne 2
1976 1964 .na
1977 1965 \fB\fIstart_date\fR\fR
1978 1966 .ad
1979 1967 .RS 14n
1980 1968 A date in the form \fIyyyy\fR/\fImm\fR/\fBdd\fR, where \fIyyyy\fR, \fImm\fR,
1981 1969 and \fBdd\fR are the year, month and day numbers respectively of the start of
1982 1970 the era. Years prior to A.D. 1 are represented as negative numbers.
1983 1971 .RE
1984 1972
1985 1973 .sp
1986 1974 .ne 2
1987 1975 .na
1988 1976 \fB\fIend_date\fR\fR
1989 1977 .ad
1990 1978 .RS 14n
1991 1979 The ending date of the era, in the same format as the \fIstart_date\fR, or one
1992 1980 of the two special values -* or +*. The value -* indicates that the ending date
1993 1981 is the beginning of time. The value +* indicates that the ending date is the
1994 1982 end of time.
1995 1983 .RE
1996 1984
1997 1985 .sp
1998 1986 .ne 2
1999 1987 .na
2000 1988 \fB\fIera_name\fR\fR
2001 1989 .ad
2002 1990 .RS 14n
2003 1991 A string representing the name of the era, corresponding to the \fB%EC\fR field
2004 1992 descriptor.
2005 1993 .RE
2006 1994
2007 1995 .sp
2008 1996 .ne 2
2009 1997 .na
2010 1998 \fB\fIera_format\fR\fR
2011 1999 .ad
2012 2000 .RS 14n
2013 2001 A string for formatting the year in the era, corresponding to the \fB%EG\fR and
2014 2002 \fB%EY\fR field descriptors.
2015 2003 .RE
2016 2004
2017 2005 .RE
2018 2006
2019 2007 .sp
2020 2008 .ne 2
2021 2009 .na
2022 2010 \fB\fBera_d_fmt\fR\fR
2023 2011 .ad
2024 2012 .RS 15n
2025 2013 Define the format of the date in alternative era notation, corresponding to the
2026 2014 \fB%Ex\fR field descriptor.
2027 2015 .RE
2028 2016
2029 2017 .sp
2030 2018 .ne 2
2031 2019 .na
2032 2020 \fB\fBera_t_fmt\fR\fR
2033 2021 .ad
2034 2022 .RS 15n
2035 2023 Define the locale's appropriate alternative time format, corresponding to the
2036 2024 \fB%EX\fR field descriptor.
2037 2025 .RE
2038 2026
2039 2027 .sp
2040 2028 .ne 2
2041 2029 .na
2042 2030 \fB\fBera_d_t_fmt\fR\fR
2043 2031 .ad
2044 2032 .RS 15n
2045 2033 Define the locale's appropriate alternative date and time format, corresponding
2046 2034 to the \fB%Ec\fR field descriptor.
2047 2035 .RE
2048 2036
2049 2037 .sp
2050 2038 .ne 2
2051 2039 .na
2052 2040 \fB\fBalt_digits\fR\fR
2053 2041 .ad
2054 2042 .RS 15n
↓ open down ↓ |
246 lines elided |
↑ open up ↑ |
2055 2043 Define alternative symbols for digits, corresponding to the \fB%O\fR field
2056 2044 descriptor modifier. The operand consists of semicolon-separated strings, each
2057 2045 surrounded by double-quotes. The first string is the alternative symbol
2058 2046 corresponding with zero, the second string the symbol corresponding with one,
2059 2047 and so on. Up to 100 alternative symbol strings can be specified. The \fB%O\fR
2060 2048 modifier indicates that the string corresponding to the value specified via the
2061 2049 field descriptor will be used instead of the value.
2062 2050 .RE
2063 2051
2064 2052 .SS "LC_TIME \fIC-language\fR Access"
2065 -.LP
2066 2053 The following information can be accessed. These correspond to constants
2067 2054 defined in <\fBlanginfo.h\fR> and used as arguments to the
2068 2055 \fBnl_langinfo\fR(3C) function.
2069 2056 .sp
2070 2057 .ne 2
2071 2058 .na
2072 2059 \fB\fBABDAY_\fIx\fR\fR\fR
2073 2060 .ad
2074 2061 .RS 15n
2075 2062 The abbreviated weekday names (for example Sun), where \fIx\fR is a number from
2076 2063 1 to 7.
2077 2064 .RE
2078 2065
2079 2066 .sp
2080 2067 .ne 2
2081 2068 .na
2082 2069 \fB\fBDAY_\fIx\fR\fR\fR
2083 2070 .ad
2084 2071 .RS 15n
2085 2072 The full weekday names (for example Sunday), where \fIx\fR is a number from 1
2086 2073 to 7.
2087 2074 .RE
2088 2075
2089 2076 .sp
2090 2077 .ne 2
2091 2078 .na
2092 2079 \fB\fBABMON_\fIx\fR\fR\fR
2093 2080 .ad
2094 2081 .RS 15n
2095 2082 The abbreviated month names (for example Jan), where \fIx\fR is a number from 1
2096 2083 to 12.
2097 2084 .RE
2098 2085
2099 2086 .sp
2100 2087 .ne 2
2101 2088 .na
2102 2089 \fB\fBMON_\fIx\fR\fR\fR
2103 2090 .ad
2104 2091 .RS 15n
2105 2092 The full month names (for example January), where \fIx\fR is a number from 1 to
2106 2093 12.
2107 2094 .RE
2108 2095
2109 2096 .sp
2110 2097 .ne 2
2111 2098 .na
2112 2099 \fB\fBD_T_FMT\fR\fR
2113 2100 .ad
2114 2101 .RS 15n
2115 2102 The appropriate date and time representation.
2116 2103 .RE
2117 2104
2118 2105 .sp
2119 2106 .ne 2
2120 2107 .na
2121 2108 \fB\fBD_FMT\fR\fR
2122 2109 .ad
2123 2110 .RS 15n
2124 2111 The appropriate date representation.
2125 2112 .RE
2126 2113
2127 2114 .sp
2128 2115 .ne 2
2129 2116 .na
2130 2117 \fB\fBT_FMT\fR\fR
2131 2118 .ad
2132 2119 .RS 15n
2133 2120 The appropriate time representation.
2134 2121 .RE
2135 2122
2136 2123 .sp
2137 2124 .ne 2
2138 2125 .na
2139 2126 \fB\fBAM_STR\fR\fR
2140 2127 .ad
2141 2128 .RS 15n
2142 2129 The appropriate ante-meridiem affix.
2143 2130 .RE
2144 2131
2145 2132 .sp
2146 2133 .ne 2
2147 2134 .na
2148 2135 \fB\fBPM_STR\fR\fR
2149 2136 .ad
2150 2137 .RS 15n
2151 2138 The appropriate post-meridiem affix.
2152 2139 .RE
2153 2140
2154 2141 .sp
2155 2142 .ne 2
2156 2143 .na
2157 2144 \fB\fBT_FMT_AMPM\fR\fR
2158 2145 .ad
2159 2146 .RS 15n
2160 2147 The appropriate time representation in the 12-hour clock format with
2161 2148 \fBAM_STR\fR and \fBPM_STR.\fR
2162 2149 .RE
2163 2150
2164 2151 .sp
2165 2152 .ne 2
2166 2153 .na
2167 2154 \fB\fBERA\fR\fR
2168 2155 .ad
2169 2156 .RS 15n
2170 2157 The era description segments, which describe how years are counted and
2171 2158 displayed for each era in a locale. Each era description segment has the
2172 2159 format:
2173 2160 .sp
2174 2161 .in +2
2175 2162 .nf
2176 2163 \fIdirection\fR:\fIoffset\fR:\fIstart_date\fR:\fIend_date\fR:\fIera_name\fR:\fIera_format\fR
2177 2164 .fi
2178 2165 .in -2
2179 2166 .sp
2180 2167
2181 2168 according to the definitions below. There will be as many era description
2182 2169 segments as are necessary to describe the different eras. Era description
2183 2170 segments are separated by semicolons.
2184 2171 .sp
2185 2172 The start of an era might not be the earliest point For example, the Christian
2186 2173 era B.C. starts on the day before January 1, A.D. 1, and increases with earlier
2187 2174 time.
2188 2175 .sp
2189 2176 .ne 2
2190 2177 .na
2191 2178 \fB\fIdirection\fR\fR
2192 2179 .ad
2193 2180 .RS 14n
2194 2181 Either a + or a - character. The + character indicates that years closer to the
2195 2182 \fIstart_date\fR have lower numbers than those closer to the \fIend_date\fR.
2196 2183 The - character indicates that years closer to the \fIstart_date\fR have higher
2197 2184 numbers than those closer to the \fIend_date\fR.
2198 2185 .RE
2199 2186
2200 2187 .sp
2201 2188 .ne 2
2202 2189 .na
2203 2190 \fB\fIoffset\fR\fR
2204 2191 .ad
2205 2192 .RS 14n
2206 2193 The number of the year closest to the start_date in the era.
2207 2194 .RE
2208 2195
2209 2196 .sp
2210 2197 .ne 2
2211 2198 .na
2212 2199 \fB\fIstart_date\fR\fR
2213 2200 .ad
2214 2201 .RS 14n
2215 2202 A date in the form \fIyyyy\fR/\fImm\fR/\fIdd\fR, where \fIyyyy\fR, \fImm\fR,
2216 2203 and \fBdd\fR are the year, month and day numbers respectively of the start of
2217 2204 the era. Years prior to AD 1 are represented as negative numbers.
2218 2205 .RE
2219 2206
2220 2207 .sp
2221 2208 .ne 2
2222 2209 .na
2223 2210 \fB\fIend_date\fR\fR
2224 2211 .ad
2225 2212 .RS 14n
2226 2213 The ending date of the era, in the same format as the \fIstart_date\fR, or one
2227 2214 of the two special values, \fB-*\fR or \fB+*\fR. The value \fB-*\fR indicates
2228 2215 that the ending date is the beginning of time. The value \fB+*\fR indicates
2229 2216 that the ending date is the end of time.
2230 2217 .RE
2231 2218
2232 2219 .sp
2233 2220 .ne 2
2234 2221 .na
2235 2222 \fB\fIera_name\fR\fR
2236 2223 .ad
2237 2224 .RS 14n
2238 2225 The era, corresponding to the \fB%EC\fR conversion specification.
2239 2226 .RE
2240 2227
2241 2228 .sp
2242 2229 .ne 2
2243 2230 .na
2244 2231 \fB\fIera_format\fR\fR
2245 2232 .ad
2246 2233 .RS 14n
2247 2234 The format of the year in the era, corresponding to the \fB%EY\fR and \fB%EY\fR
2248 2235 conversion specifications.
2249 2236 .RE
2250 2237
2251 2238 .RE
2252 2239
2253 2240 .sp
2254 2241 .ne 2
2255 2242 .na
2256 2243 \fB\fBERA_D_FMT\fR\fR
2257 2244 .ad
2258 2245 .RS 15n
2259 2246 The era date format.
2260 2247 .RE
2261 2248
2262 2249 .sp
2263 2250 .ne 2
2264 2251 .na
2265 2252 \fB\fBERA_T_FMT\fR\fR
2266 2253 .ad
2267 2254 .RS 15n
2268 2255 The locale's appropriate alternative time format, corresponding to the
2269 2256 \fB%EX\fR field descriptor.
2270 2257 .RE
2271 2258
2272 2259 .sp
2273 2260 .ne 2
2274 2261 .na
2275 2262 \fB\fBERA_D_T_FMT\fR\fR
2276 2263 .ad
2277 2264 .RS 15n
2278 2265 The locale's appropriate alternative date and time format, corresponding to the
2279 2266 \fB%Ec\fR field descriptor.
2280 2267 .RE
2281 2268
2282 2269 .sp
2283 2270 .ne 2
2284 2271 .na
2285 2272 \fB\fBALT_DIGITS\fR\fR
2286 2273 .ad
2287 2274 .RS 15n
2288 2275 The alternative symbols for digits, corresponding to the \fB%O\fR conversion
2289 2276 specification modifier. The value consists of semicolon-separated symbols. The
2290 2277 first is the alternative symbol corresponding to zero, the second is the symbol
2291 2278 corresponding to one, and so on. Up to 100 alternative symbols may be
2292 2279 specified. The following table displays the correspondence between the items
2293 2280 described above and the conversion specifiers used by \fBdate\fR(1) and the
2294 2281 \fBstrftime\fR(3C), \fBwcsftime\fR(3C), and \fBstrptime\fR(3C) functions.
2295 2282 .RE
2296 2283
2297 2284 .sp
2298 2285
2299 2286 .sp
2300 2287 .TS
2301 2288 box;
2302 2289 c | c | c
2303 2290 c | c | c .
2304 2291 \fBlocaledef\fR \fBlanginfo\fR \fBConversion\fR
2305 2292 \fBKeyword\fR \fBConstant\fR \fBSpecifier\fR
2306 2293 _
2307 2294 \fBabday\fR \fBABDAY_\fR\fIx\fR \fB%a\fR
2308 2295 \fBday\fR \fBDAY_\fR\fIx\fR \fB%A\fR
2309 2296 \fBabmon\fR \fBABMON_\fR\fIx\fR \fB%b\fR
2310 2297 \fBmon\fR \fBMON\fR \fB%B\fR
2311 2298 \fBd_t_fmt\fR \fBD_T_FMT\fR \fB%c\fR
2312 2299 \fBdate_fmt\fR \fBDATE_FMT\fR \fB%C\fR
2313 2300 \fBd_fmt\fR \fBD_FMT\fR \fB%x\fR
2314 2301 \fBt_fmt\fR \fBT_FMT\fR \fB%X\fR
2315 2302 \fBam_pm\fR \fBAM_STR\fR \fB%p\fR
2316 2303 \fBam_pm\fR \fBPM_STR\fR \fB%p\fR
↓ open down ↓ |
241 lines elided |
↑ open up ↑ |
2317 2304 \fBt_fmt_ampm\fR \fBT_FMT_AMPM\fR \fB%r\fR
2318 2305 \fBera\fR \fBERA\fR \fB%EC, %Eg,\fR
2319 2306 \fB%EG, %Ey, %EY\fR
2320 2307 \fBera_d_fmt\fR \fBERA_D_FMT\fR \fB%Ex\fR
2321 2308 \fBera_t_fmt\fR \fBERA_T_FMT\fR \fB%EX\fR
2322 2309 \fBera_d_t_fmt\fR \fBERA_D_T_FMT\fR \fB%Ec\fR
2323 2310 \fBalt_digits\fR \fBALT_DIGITS\fR \fB%O\fR
2324 2311 .TE
2325 2312
2326 2313 .SS "LC_TIME \fIGeneral\fR Information"
2327 -.LP
2328 2314 Although certain of the field descriptors in the POSIX locale (such as the name
2329 2315 of the month) are shown with initial capital letters, this need not be the case
2330 2316 in other locales. Programs using these fields may need to adjust the
2331 2317 capitalization if the output is going to be used at the beginning of a
2332 2318 sentence.
2333 2319 .sp
2334 2320 .LP
2335 2321 The \fBLC_TIME\fR descriptions of \fBabday\fR, \fBday\fR, \fBmon\fR, and
2336 2322 \fBabmon\fR imply a Gregorian style calendar (7-day weeks, 12-month years, leap
2337 2323 years, and so forth). Formatting time strings for other types of calendars is
2338 2324 outside the scope of this document set.
2339 2325 .sp
2340 2326 .LP
2341 2327 As specified under \fBdate\fR in \fBLocale Definition\fR and
2342 2328 \fBstrftime\fR(3C), the field descriptors corresponding to the optional
2343 2329 keywords consist of a modifier followed by a traditional field descriptor (for
2344 2330 instance \fB%Ex\fR). If the optional keywords are not supported by the
2345 2331 implementation or are unspecified for the current locale, these field
2346 2332 descriptors are treated as the traditional field descriptor. For instance,
2347 2333 assume the following keywords:
2348 2334 .sp
2349 2335 .in +2
2350 2336 .nf
2351 2337 alt_digits "0th" ; "1st" ; "2nd" ; "3rd" ; "4th" ; "5th" ; \e
2352 2338 "6th" ; "7th" ; "8th" ; "9th" ; "10th">
2353 2339 d_fmt "The %Od day of %B in %Y"
2354 2340 .fi
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
2355 2341 .in -2
2356 2342 .sp
2357 2343
2358 2344 .sp
2359 2345 .LP
2360 2346 On 7/4/1776, the \fB%x\fR field descriptor would result in "The 4th day of July
2361 2347 in 1776" while 7/14/1789 would come out as "The 14 day of July in 1789" The
2362 2348 above example is for illustrative purposes only. The \fB%O\fR modifier is
2363 2349 primarily intended to provide for Kanji or Hindi digits in \fBdate\fR formats.
2364 2350 .SS "LC_MESSAGES"
2365 -.LP
2366 2351 The \fBLC_MESSAGES\fR category defines the format and values for affirmative
2367 2352 and negative responses.
2368 2353 .sp
2369 2354 .LP
2370 2355 The following keywords are recognized as part of the locale definition file.
2371 2356 The \fBnl_langinfo\fR(3C) function accepts upper-case versions of the first
2372 2357 four keywords.
2373 2358 .sp
2374 2359 .ne 2
2375 2360 .na
2376 2361 \fB\fByesexpr\fR\fR
2377 2362 .ad
2378 2363 .RS 11n
2379 2364 The operand consists of an extended regular expression (see \fBregex\fR(5))
2380 2365 that describes the acceptable affirmative response to a question expecting an
2381 2366 affirmative or negative response.
2382 2367 .RE
2383 2368
2384 2369 .sp
2385 2370 .ne 2
2386 2371 .na
2387 2372 \fB\fBnoexpr\fR\fR
2388 2373 .ad
2389 2374 .RS 11n
2390 2375 The operand consists of an extended regular expression that describes the
2391 2376 acceptable negative response to a question expecting an affirmative or negative
2392 2377 response.
2393 2378 .RE
2394 2379
2395 2380 .sp
2396 2381 .ne 2
2397 2382 .na
2398 2383 \fB\fByesstr\fR\fR
2399 2384 .ad
2400 2385 .RS 11n
2401 2386 The operand consists of a fixed string (not a regular expression) that can be
2402 2387 used by an application for composition of a message that lists an acceptable
2403 2388 affirmative response, such as in a prompt.
2404 2389 .RE
2405 2390
2406 2391 .sp
2407 2392 .ne 2
2408 2393 .na
2409 2394 \fB\fBnostr\fR\fR
2410 2395 .ad
2411 2396 .RS 11n
2412 2397 The operand consists of a fixed string that can be used by an application for
2413 2398 composition of a message that lists an acceptable negative response. The format
2414 2399 and values for affirmative and negative responses of the POSIX locale follow;
2415 2400 the code listing depicting the \fBlocaledef\fR input, the table representing
2416 2401 the same information with the addition of \fBnl_langinfo()\fR constants.
2417 2402 .sp
2418 2403 .in +2
2419 2404 .nf
2420 2405 LC_MESSAGES
2421 2406 # This is the POSIX locale definition for
2422 2407 # the LC_MESSAGES category.
2423 2408 #
2424 2409 yesexpr "<circumflex><left-square-bracket><y><Y>\e
2425 2410 <right-square-bracket>"
2426 2411 #
2427 2412 noexpr "<circumflex><left-square-bracket><n><N>\e
2428 2413 <right-square-bracket>"
2429 2414 #
2430 2415 yesstr "yes"
2431 2416 nostr "no"
2432 2417 END LC_MESSAGES
2433 2418 .fi
2434 2419 .in -2
2435 2420 .sp
2436 2421
2437 2422 .RE
2438 2423
2439 2424 .sp
2440 2425
2441 2426 .sp
2442 2427 .TS
2443 2428 box;
2444 2429 l | l | l
2445 2430 l | l | l .
2446 2431 \fBlocaledef Keyword\fR \fBlanginfo Constant\fR \fBPOSIX Locale Value\fR
2447 2432 \fByesexpr\fR \fBYESEXPR\fR \fB"^[yY]"\fR
↓ open down ↓ |
72 lines elided |
↑ open up ↑ |
2448 2433 \fBnoexpr\fR \fBNOEXPR\fR \fB"^[nN]"\fR
2449 2434 \fByesstr\fR \fBYESSTR\fR \fB"yes"\fR
2450 2435 \fBnostr\fR \fBNOSTR\fR \fB"no"\fR
2451 2436 .TE
2452 2437
2453 2438 .sp
2454 2439 .LP
2455 2440 In an application conforming to the SUSv3 standard, the information on
2456 2441 \fByesstr\fR and \fBnostr\fR is not available.
2457 2442 .SH SEE ALSO
2458 -.LP
2459 2443 \fBdate\fR(1), \fBlocale\fR(1), \fBlocaledef\fR(1), \fBsort\fR(1), \fBtr\fR(1),
2460 2444 \fBuniq\fR(1), \fBlocaleconv\fR(3C), \fBnl_langinfo\fR(3C),
2461 2445 \fBsetlocale\fR(3C), \fBstrcoll\fR(3C), \fBstrftime\fR(3C), \fBstrptime\fR(3C),
2462 2446 \fBstrxfrm\fR(3C), \fBwcscoll\fR(3C), \fBwcsftime\fR(3C), \fBwcsxfrm\fR(3C),
2463 2447 \fBwctype\fR(3C), \fBattributes\fR(5), \fBcharmap\fR(5), \fBextensions\fR(5),
2464 2448 \fBregex\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX