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