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