2 .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
4 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
5 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
6 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
7 .\" This notice shall appear on any product containing this material.
8 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
9 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
10 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
11 .TH LOCALE 5 "April 9, 2016"
13 locale \- subset of a user's environment that depends on language and cultural
17 A \fBlocale\fR is the definition of the subset of a user's environment that
18 depends on language and cultural conventions. It is made up from one or more
19 categories. Each category is identified by its name and controls specific
20 aspects of the behavior of components of the system. Category names correspond
21 to the following environment variable names:
28 Character classification and case conversion.
34 \fB\fBLC_COLLATE\fR\fR
46 Date and time formats.
52 \fB\fBLC_NUMERIC\fR\fR
61 \fB\fBLC_MONETARY\fR\fR
70 \fB\fBLC_MESSAGES\fR\fR
73 Formats of informative and diagnostic messages and interactive responses.
78 The standard utilities base their behavior on the current locale, as defined
79 in the ENVIRONMENT VARIABLES section for each utility. The behavior of some of
80 the C-language functions will also be modified based on the current locale, as
81 defined by the last call to \fBsetlocale\fR(3C).
84 Locales other than those supplied by the implementation can be created by the
85 application via the \fBlocaledef\fR(1) utility. The value that is used to
86 specify a locale when using environment variables will be the string specified
87 as the \fIname\fR operand to \fBlocaledef\fR when the locale was created. The
88 strings "C" and "POSIX" are reserved as identifiers for the POSIX locale.
91 Applications can select the desired locale by invoking the \fBsetlocale()\fR
92 function with the appropriate value. If the function is invoked with an empty
97 setlocale(LC_ALL, "");
103 the value of the corresponding environment variable is used. If the environment
104 variable is unset or is set to the empty string, the \fBsetlocale()\fR
105 function sets the appropriate environment.
106 .SS "Locale Definition"
108 Locales can be described with the file format accepted by the \fBlocaledef\fR
112 The locale definition file must contain one or more locale category source
113 definitions, and must not contain more than one definition for the same locale
117 A category source definition consists of a category header, a category body and
118 a category trailer. A category header consists of the character string naming
119 of the category, beginning with the characters \fBLC_\fR. The category trailer
120 consists of the string \fBEND\fR, followed by one or more blank characters and
121 the string used in the corresponding category header.
124 The category body consists of one or more lines of text. Each line contains an
125 identifier, optionally followed by one or more operands. Identifiers are either
126 keywords, identifying a particular locale element, or collating elements. Each
127 keyword within a locale must have a unique name (that is, two categories cannot
128 have a commonly-named keyword). No keyword can start with the characters
129 \fBLC_\fR. Identifiers must be separated from the operands by one or more blank
133 Operands must be characters, collating elements, or strings of characters.
134 Strings must be enclosed in double-quotes (\fB"\fR). Literal double-quotes
135 within strings must be preceded by the <\fIescape character\fR>, as described
136 below. When a keyword is followed by more than one operand, the operands must
137 be separated by semicolons (\fB;\fR). Blank characters are allowed both before
138 and after a semicolon.
141 The first category header in the file can be preceded by a line modifying the
142 comment character. It has the following format, starting in column 1:
146 "comment_char %c\en",<\fIcomment character\fR>
152 The comment character defaults to the number sign (\fB#\fR). Blank lines and
153 lines containing the <\fIcomment character\fR> in the first position are
157 The first category header in the file can be preceded by a line modifying the
158 escape character to be used in the file. It has the following format, starting
163 "escape_char %c\en",<\fIescape character\fR>
170 The escape character defaults to backslash.
173 A line can be continued by placing an escape character as the last character on
174 the line; this continuation character will be discarded from the input.
175 Although the implementation need not accept any one portion of a continued line
176 with a length exceeding \fB{LINE_MAX}\fR bytes, it places no limits on the
177 accumulated length of the continued line. Comment lines cannot be continued on
178 a subsequent line using an escaped newline character.
181 Individual characters, characters in strings, and collating elements must be
182 represented using symbolic names, as defined below. In addition, characters can
183 be represented using the characters themselves or as octal, hexadecimal or
184 decimal constants. When non-symbolic notation is used, the resultant locale
185 definitions will in many cases not be portable between systems. The left angle
186 bracket (\fB<\fR) is a reserved symbol, denoting the start of a symbolic name;
187 when used to represent itself it must be preceded by the escape character. The
188 following rules apply to character representation:
192 A character can be represented via a symbolic name, enclosed within angle
193 brackets \fB<\fR and \fB>\fR. The symbolic name, including the angle brackets,
194 must exactly match a symbolic name defined in the charmap file specified via
195 the \fBlocaledef\fR \fB-f\fR option, and will be replaced by a character value
196 determined from the value associated with the symbolic name in the charmap
197 file. The use of a symbolic name not found in the charmap file constitutes an
198 error, unless the category is \fBLC_CTYPE\fR or \fBLC_COLLATE\fR, in which
199 case it constitutes a warning condition (see \fBlocaledef\fR(1) for a
200 description of action resulting from errors and warnings). The specification of
201 a symbolic name in a \fBcollating-element\fR or \fBcollating-symbol\fR section
202 that duplicates a symbolic name in the charmap file (if present) is an error.
203 Use of the escape character or a right angle bracket within a symbolic name is
204 invalid unless the character is preceded by the escape character.
210 <C>;<c-cedilla> "<M><a><y>"
219 A character can be represented by the character itself, in which case the
220 value of the character is implementation-dependent. Within a string, the
221 double-quote character, the escape character and the right angle bracket
222 character must be escaped (preceded by the escape character) to be interpreted
223 as the character itself. Outside strings, the characters
227 \fB, ; < >\fR \fIescape_char\fR
232 must be escaped to be interpreted as the character itself.
247 A character can be represented as an octal constant. An octal constant is
248 specified as the escape character followed by two or more octal digits. Each
249 constant represents a byte value. Multi-byte values can be represented by
250 concatenated constants specified in byte order with the last constant
251 specifying the least significant byte of the character.
257 \e143;\e347;\e143\e150 "\e115\e141\e171"
266 A character can be represented as a hexadecimal constant. A hexadecimal
267 constant is specified as the escape character followed by an \fBx\fR followed
268 by two or more hexadecimal digits. Each constant represents a byte value.
269 Multi-byte values can be represented by concatenated constants specified in
270 byte order with the last constant specifying the least significant byte of the
277 \ex63;\exe7;\ex63\ex68 "\ex4d\ex61\ex79"
286 A character can be represented as a decimal constant. A decimal constant is
287 specified as the escape character followed by a \fBd\fR followed by two or more
288 decimal digits. Each constant represents a byte value. Multi-byte values can be
289 represented by concatenated constants specified in byte order with the last
290 constant specifying the least significant byte of the character.
296 \ed99;\ed231;\ed99\ed104 "\ed77\ed97\ed121"
301 Only characters existing in the character set for which the locale definition
302 is created can be specified, whether using symbolic names, the characters
303 themselves, or octal, decimal or hexadecimal constants. If a charmap file is
304 present, only characters defined in the charmap can be specified using octal,
305 decimal or hexadecimal constants. Symbolic names not present in the charmap
306 file can be specified and will be ignored, as specified under item 1 above.
310 The \fBLC_CTYPE\fR category defines character classification, case conversion
311 and other character attributes. In addition, a series of characters can be
312 represented by three adjacent periods representing an ellipsis symbol
313 (\fB\&...\fR). The ellipsis specification is interpreted as meaning that all
314 values between the values preceding and following it represent valid
315 characters. The ellipsis specification is valid only within a single encoded
316 character set, that is, within a group of characters of the same size. An
317 ellipsis is interpreted as including in the list all characters with an encoded
318 value higher than the encoded value of the character preceding the ellipsis and
319 lower than the encoded value of the character following the ellipsis.
333 includes in the character class all characters with encoded values between the
337 The following keywords are recognized. In the descriptions, the term
338 ``automatically included'' means that it is not an error either to include or
339 omit any of the referenced characters.
342 The character classes \fBdigit\fR, \fBxdigit\fR, \fBlower\fR, \fBupper\fR, and
343 \fBspace\fR have a set of automatically included characters. These only need to
344 be specified if the character values (that is, encoding) differ from the
345 implementation default values.
352 Define characters to be classified as upper-case letters.
354 In the POSIX locale, the 26 upper-case letters are included:
358 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
363 In a locale definition file, no character specified for the keywords
364 \fBcntrl\fR, \fBdigit\fR, \fBpunct\fR, or \fBspace\fR can be specified. The
365 upper-case letters \fBA\fR to \fBZ\fR are automatically included in this class.
374 Define characters to be classified as lower-case letters. In the POSIX locale,
375 the 26 lower-case letters are included:
379 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
384 In a locale definition file, no character specified for the keywords
385 \fBcntrl\fR, \fBdigit\fR, \fBpunct\fR, or \fBspace\fR can be specified. The
386 lower-case letters \fBa\fR to \fBz\fR of the portable character set are
387 automatically included in this class.
396 Define characters to be classified as letters.
398 In the POSIX locale, all characters in the classes \fBupper\fR and \fBlower\fR
401 In a locale definition file, no character specified for the keywords
402 \fBcntrl\fR, \fBdigit\fR, \fBpunct\fR, or \fBspace\fR can be specified.
403 Characters classified as either \fBupper\fR or \fBlower\fR are automatically
404 included in this class.
413 Define the characters to be classified as numeric digits.
415 In the POSIX locale, only
426 In a locale definition file, only the digits \fB0\fR, \fB1\fR, \fB2\fR,
427 \fB3\fR, \fB4\fR, \fB5\fR, \fB6\fR, \fB7\fR, \fB8\fR, and \fB9\fR can be
428 specified, and in contiguous ascending sequence by numerical value. The digits
429 \fB0\fR to \fB9\fR of the portable character set are automatically included in
432 The definition of character class \fBdigit\fR requires that only ten
433 characters; the ones defining digits can be specified; alternative digits (for
434 example, Hindi or Kanji) cannot be specified here.
443 Define characters to be classified as letters and numeric digits. Only the
444 characters specified for the \fBalpha\fR and \fBdigit\fR keywords are
445 specified. Characters specified for the keywords \fBalpha\fR and \fBdigit\fR
446 are automatically included in this class.
455 Define characters to be classified as white-space characters.
457 In the POSIX locale, at a minimum, the characters \fBSPACE\fR, \fBFORMFEED\fR,
458 \fBNEWLINE\fR, \fBCARRIAGE RETURN\fR, \fBTAB\fR, and \fBVERTICAL TAB\fR are
461 In a locale definition file, no character specified for the keywords
462 \fBupper\fR, \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBgraph\fR, or
463 \fBxdigit\fR can be specified. The characters \fBSPACE\fR, \fBFORMFEED\fR,
464 \fBNEWLINE\fR, \fBCARRIAGE RETURN\fR, \fBTAB\fR, and \fBVERTICAL TAB\fR of the
465 portable character set, and any characters included in the class \fBblank\fR
466 are automatically included in this class.
475 Define characters to be classified as control characters.
477 In the POSIX locale, no characters in classes \fBalpha\fR or \fBprint\fR are
480 In a locale definition file, no character specified for the keywords
481 \fBupper\fR, \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBpunct\fR, \fBgraph\fR,
482 \fBprint\fR, or \fBxdigit\fR can be specified.
491 Define characters to be classified as punctuation characters.
493 In the POSIX locale, neither the space character nor any characters in classes
494 \fBalpha\fR, \fBdigit\fR, or \fBcntrl\fR are included.
496 In a locale definition file, no character specified for the keywords
497 \fBupper\fR, \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBcntrl\fR, \fBxdigit\fR
498 or as the space character can be specified.
507 Define characters to be classified as printable characters, not including the
510 In the POSIX locale, all characters in classes \fBalpha\fR, \fBdigit\fR, and
511 \fBpunct\fR are included; no characters in class \fBcntrl\fR are included.
513 In a locale definition file, characters specified for the keywords \fBupper\fR,
514 \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBxdigit\fR, and \fBpunct\fR are
515 automatically included in this class. No character specified for the keyword
516 \fBcntrl\fR can be specified.
525 Define characters to be classified as printable characters, including the space
528 In the POSIX locale, all characters in class \fBgraph\fR are included; no
529 characters in class \fBcntrl\fR are included.
531 In a locale definition file, characters specified for the keywords \fBupper\fR,
532 \fBlower\fR, \fBalpha\fR, \fBdigit\fR, \fBxdigit\fR, \fBpunct\fR, and the space
533 character are automatically included in this class. No character specified for
534 the keyword \fBcntrl\fR can be specified.
543 Define the characters to be classified as hexadecimal digits.
545 In the POSIX locale, only:
549 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
556 In a locale definition file, only the characters defined for the class
557 \fBdigit\fR can be specified, in contiguous ascending sequence by numerical
558 value, followed by one or more sets of six characters representing the
559 hexadecimal digits 10 to 15 inclusive, with each set in ascending order (for
560 example \fBA\fR, \fBB\fR, \fBC\fR, \fBD\fR, \fBE\fR, \fBF\fR, \fBa\fR, \fBb\fR,
561 \fBc\fR, \fBd\fR, \fBe\fR, \fBf\fR). The digits \fB0\fR to \fB9\fR, the
562 upper-case letters \fBA\fR to \fBF\fR and the lower-case letters \fBa\fR to
563 \fBf\fR of the portable character set are automatically included in this class.
565 The definition of character class \fBxdigit\fR requires that the characters
566 included in character class \fBdigit\fR be included here also.
575 Define characters to be classified as blank characters.
577 In the POSIX locale, only the space and tab characters are included.
579 In a locale definition file, the characters space and tab are automatically
580 included in this class.
586 \fB\fBcharclass\fR\fR
589 Define one or more locale-specific character class names as strings separated
590 by semi-colons. Each named character class can then be defined subsequently in
591 the \fBLC_CTYPE\fR definition. A character class name consists of at least one
592 and at most \fB{CHARCLASS_NAME_MAX}\fR bytes of alphanumeric characters from
593 the portable filename character set. The first character of a character class
594 name cannot be a digit. The name cannot match any of the \fBLC_CTYPE\fR
595 keywords defined in this document.
601 \fB\fBcharclass-name\fR\fR
604 Define characters to be classified as belonging to the named locale-specific
605 character class. In the POSIX locale, the locale-specific named character
606 classes need not exist. If a class name is defined by a \fBcharclass\fR
607 keyword, but no characters are subsequently assigned to it, this is not an
608 error; it represents a class without any characters belonging to it. The
609 \fBcharclass-name\fR can be used as the \fIproperty\fR argument to the
610 \fBwctype\fR(3C) function, in regular expression and shell pattern-matching
611 bracket expressions, and by the \fBtr\fR(1) command.
620 Define the mapping of lower-case letters to upper-case letters.
622 In the POSIX locale, at a minimum, the 26 lower-case characters:
626 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
631 are mapped to the corresponding 26 upper-case characters:
635 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
640 In a locale definition file, the operand consists of character pairs, separated
641 by semicolons. The characters in each character pair are separated by a comma
642 and the pair enclosed by parentheses. The first character in each pair is the
643 lower-case letter, the second the corresponding upper-case letter. Only
644 characters specified for the keywords \fBlower\fR and \fBupper\fR can be
645 specified. The lower-case letters \fBa\fR to \fBz\fR, and their corresponding
646 upper-case letters \fBA\fR to \fBZ\fR, of the portable character set are
647 automatically included in this mapping, but only when the \fBtoupper\fR keyword
648 is omitted from the locale definition.
657 Define the mapping of upper-case letters to lower-case letters.
659 In the POSIX locale, at a minimum, the 26 upper-case characters:
663 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 are mapped to the corresponding 26 lower-case characters:
672 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
677 In a locale definition file, the operand consists of character pairs, separated
678 by semicolons. The characters in each character pair are separated by a comma
679 and the pair enclosed by parentheses. The first character in each pair is the
680 upper-case letter, the second the corresponding lower-case letter. Only
681 characters specified for the keywords \fBlower\fR and \fBupper\fR can be
682 specified. If the \fBtolower\fR keyword is omitted from the locale definition,
683 the mapping will be the reverse mapping of the one specified for \fBtoupper\fR.
688 The \fBLC_COLLATE\fR category provides a collation sequence definition for
689 numerous utilities (such as \fBsort\fR(1), \fBuniq\fR(1), and so forth),
690 regular expression matching (see \fBregex\fR(5)), and the \fBstrcoll\fR(3C),
691 \fBstrxfrm\fR(3C), \fBwcscoll\fR(3C), and \fBwcsxfrm\fR(3C) functions.
694 A collation sequence definition defines the relative order between collating
695 elements (characters and multi-character collating elements) in the locale.
696 This order is expressed in terms of collation values, that is, by assigning
697 each element one or more collation values (also known as collation weights).
698 The following capabilities are provided:
702 \fBMulti-character collating elements\fR. Specification of multi-character
703 collating elements (that is, sequences of two or more characters to be collated
709 \fBUser-defined ordering of collating elements\fR. Each collating element is
710 assigned a collation value defining its order in the character (or basic)
711 collation sequence. This ordering is used by regular expressions and pattern
712 matching and, unless collation weights are explicity specified, also as the
713 collation weight to be used in sorting.
718 \fBMultiple weights and equivalence classes\fR. Collating elements can be
719 assigned one or more (up to the limit \fB{COLL_WEIGHTS_MAX}\fR \fB)\fR
720 collating weights for use in sorting. The first weight is hereafter referred to
721 as the primary weight.
726 \fBOne-to-Many mapping\fR. A single character is mapped into a string of
732 \fBEquivalence class definition\fR. Two or more collating elements have the
733 same collation value (primary weight).
738 \fBOrdering by weights\fR. When two strings are compared to determine their
739 relative order, the two strings are first broken up into a series of collating
740 elements. The elements in each successive pair of elements are then compared
741 according to the relative primary weights for the elements. If equal, and more
742 than one weight has been assigned, the pairs of collating elements are
743 recompared according to the relative subsequent weights, until either a pair of
744 collating elements compare unequal or the weights are exhausted.
748 The following keywords are recognized in a collation sequence definition. They
749 are described in detail in the following sections.
756 Specify the name of an existing locale which is used as the definition of this
757 category. If this keyword is specified, no other keyword is specified.
763 \fB\fBcollating-element\fR\fR
766 Define a collating-element symbol representing a multi-character collating
767 element. This keyword is optional.
773 \fB\fBcollating-symbol\fR\fR
776 Define a collating symbol for use in collation order statements. This keyword
783 \fB\fBorder_start\fR\fR
786 Define collation rules. This statement is followed by one or more collation
787 order statements, assigning character collation values and collation weights to
794 \fB\fBorder_end\fR\fR
797 Specify the end of the collation-order statements.
800 .SS "collating-element \fIkeyword\fR"
802 In addition to the collating elements in the character set, the
803 \fBcollating-element\fR keyword is used to define multi-character collating
804 elements. The syntax is:
808 \fB"collating-element %s from \e"%s\e"\en",\fR<\fIcollating-symbol\fR>,<\fIstring\fR>
814 The <\fIcollating-symbol\fR> operand is a symbolic name, enclosed between angle
815 brackets (\fB<\fR and \fB>\fR), and must not duplicate any symbolic name in the
816 current charmap file (if any), or any other symbolic name defined in this
817 collation definition. The string operand is a string of two or more characters
818 that collates as an entity. A <\fIcollating-element\fR> defined via this
819 keyword is only recognized with the \fBLC_COLLATE\fR category.
825 \fBcollating-element\fR <\fBch\fR> from "<\fBc\fR><\fBh\fR>"
829 \fBcollating-element\fR <\fBe-acute\fR> from "<\fBacute\fR><\fBe\fR>"
833 \fBcollating-element\fR <\fBll\fR> from "\fBll\fR"
835 .SS "collating-symbol \fIkeyword\fR"
837 This keyword will be used to define symbols for use in collation sequence
838 statements; that is, between the \fBorder_start\fR and the \fBorder_end\fR
839 keywords. The syntax is:
843 \fB"collating-symbol %s\en",\fR<\fIcollating-symbol\fR>
849 The \fB<\fR\fIcollating-symbol\fR\fB>\fR is a symbolic name, enclosed between
850 angle brackets (\fB<\fR and \fB>\fR), and must not duplicate any symbolic name
851 in the current charmap file (if any), or any other symbolic name defined in
852 this collation definition.
855 A \fBcollating-symbol\fR defined via this keyword is only recognized with the
856 \fBLC_COLLATE\fR category.
862 \fBcollating-symbol\fR <\fBUPPER_CASE\fR>
866 \fBcollating-symbol\fR <\fBHIGH\fR>
870 The \fBcollating-symbol\fR keyword defines a symbolic name that can be
871 associated with a relative position in the character order sequence. While such
872 a symbolic name does not represent any collating element, it can be used as a
874 .SS "order_start \fIkeyword\fR"
876 The \fBorder_start\fR keyword must precede collation order entries and also
877 defines the number of weights for this collation sequence definition and other
881 The syntax of the \fBorder_start\fR keyword is:
885 \fB"order_start %s;%s;...;%s\en",\fR<\fIsort-rules\fR>,<\fIsort-rules\fR>
891 The operands to the \fBorder_start\fR keyword are optional. If present, the
892 operands define rules to be applied when strings are compared. The number of
893 operands define how many weights each element is assigned. If no operands are
894 present, one \fBforward\fR operand is assumed. If present, the first operand
895 defines rules to be applied when comparing strings using the first (primary)
896 weight; the second when comparing strings using the second weight, and so on.
897 Operands are separated by semicolons (\fB;\fR). Each operand consists of one or
898 more collation directives, separated by commas (\fB,\fR). If the number of
899 operands exceeds the \fB{COLL_WEIGHTS_MAX}\fR limit, the utility will issue a
900 warning message. The following directives will be supported:
907 Specifies that comparison operations for the weight level proceed from start of
908 string towards the end of string.
917 Specifies that comparison operations for the weight level proceed from end of
918 string towards the beginning of string.
927 Specifies that comparison operations for the weight level will consider the
928 relative position of elements in the strings not subject to \fBIGNORE.\fR The
929 string containing an element not subject to \fBIGNORE\fR after the fewest
930 collating elements subject to \fBIGNORE\fR from the start of the compare will
931 collate first. If both strings contain a character not subject to \fBIGNORE\fR
932 in the same relative position, the collating values assigned to the elements
933 will determine the ordering. In case of equality, subsequent characters not
934 subject to \fBIGNORE\fR are considered in the same manner.
939 The directives \fBforward\fR and \fBbackward\fR are mutually exclusive.
946 order_start forward;backward
953 If no operands are specified, a single \fBforward\fR operand is assumed.
954 .SS "Collation Order"
956 The \fBorder_start\fR keyword is followed by collating identifier entries. The
957 syntax for the collating element entries is:
961 \fB"%s %s;%s;...;%s\en"\fR<\fIcollating-identifier\fR>,<\fIweight\fR>,<\fIweight\fR>\fB,...\fR
967 Each \fIcollating-identifier\fR consists of either a character described in
968 \fBLocale Definition\fR above, a <\fIcollating-element\fR>, a
969 <\fIcollating-symbol\fR>, an ellipsis, or the special symbol \fBUNDEFINED\fR.
970 The order in which collating elements are specified determines the character
971 order sequence, such that each collating element compares less than the
972 elements following it. The \fBNUL\fR character compares lower than any other
976 A <\fIcollating-element\fR> is used to specify multi-character collating
977 elements, and indicates that the character sequence specified via the
978 <\fIcollating-element\fR> is to be collated as a unit and in the relative order
979 specified by its place.
982 A <\fIcollating-symbol\fR> is used to define a position in the relative order
983 for use in weights. No weights are specified with a <\fIcollating-symbol\fR>.
986 The ellipsis symbol specifies that a sequence of characters will collate
987 according to their encoded character values. It is interpreted as indicating
988 that all characters with a coded character set value higher than the value of
989 the character in the preceding line, and lower than the coded character set
990 value for the character in the following line, in the current coded character
991 set, will be placed in the character collation order between the previous and
992 the following character in ascending order according to their coded character
993 set values. An initial ellipsis is interpreted as if the preceding line
994 specified the NUL character, and a trailing ellipsis as if the following line
995 specified the highest coded character set value in the current coded character
996 set. An ellipsis is treated as invalid if the preceding or following lines do
997 not specify characters in the current coded character set. The use of the
998 ellipsis symbol ties the definition to a specific coded character set and may
999 preclude the definition from being portable between implementations.
1002 The symbol \fBUNDEFINED\fR is interpreted as including all coded character set
1003 values not specified explicitly or via the ellipsis symbol. Such characters are
1004 inserted in the character collation order at the point indicated by the symbol,
1005 and in ascending order according to their coded character set values. If no
1006 \fBUNDEFINED\fR symbol is specified, and the current coded character set
1007 contains characters not specified in this section, the utility will issue a
1008 warning message and place such characters at the end of the character collation
1012 The optional operands for each collation-element are used to define the
1013 primary, secondary, or subsequent weights for the collating element. The first
1014 operand specifies the relative primary weight, the second the relative
1015 secondary weight, and so on. Two or more collation-elements can be assigned the
1016 same weight; they belong to the same \fIequivalence class\fR if they have the
1017 same primary weight. Collation behaves as if, for each weight level, elements
1018 subject to \fBIGNORE\fR are removed, unless the \fBposition\fR collation
1019 directive is specified for the corresponding level with the \fBorder_start\fR
1020 keyword. Then each successive pair of elements is compared according to the
1021 relative weights for the elements. If the two strings compare equal, the
1022 process is repeated for the next weight level, up to the limit
1023 {\fBCOLL_WEIGHTS_MAX\fR}.
1026 Weights are expressed as characters described in \fBLocale Definition\fR
1027 above, <\fIcollating-symbol\fR>s, <\fIcollating-element\fR>s, an ellipsis, or
1028 the special symbol \fBIGNORE.\fR A single character, a <\fIcollating-symbol\fR>
1029 or a <\fIcollating-element\fR> represent the relative position in the character
1030 collating sequence of the character or symbol, rather than the character or
1031 characters themselves. Thus, rather than assigning absolute values to weights,
1032 a particular weight is expressed using the relative order value assigned to a
1033 collating element based on its order in the character collation sequence.
1036 One-to-many mapping is indicated by specifying two or more concatenated
1037 characters or symbolic names. For example, if the character <\fBeszet\fR> is
1038 given the string "<\fBs\fR><\fBs\fR>" as a weight, comparisons are performed as
1039 if all occurrences of the character <\fBeszet\fR> are replaced by
1040 <\fBs\fR><\fBs\fR> (assuming that <\fBs\fR> has the collating weight
1041 <\fBs\fR>). If it is necessary to define <\fBeszet\fR> and <\fBs\fR><\fBs\fR>
1042 as an equivalence class, then a collating element must be defined for the
1046 All characters specified via an ellipsis will by default be assigned unique
1047 weights, equal to the relative order of characters. Characters specified via an
1048 explicit or implicit \fBUNDEFINED\fR special symbol will by default be assigned
1049 the same primary weight (that is, belong to the same equivalence class). An
1050 ellipsis symbol as a weight is interpreted to mean that each character in the
1051 sequence has unique weights, equal to the relative order of their character in
1052 the character collation sequence. The use of the ellipsis as a weight is
1053 treated as an error if the collating element is neither an ellipsis nor the
1054 special symbol \fBUNDEFINED\fR.
1057 The special keyword \fBIGNORE\fR as a weight indicates that when strings are
1058 compared using the weights at the level where \fBIGNORE\fR is specified, the
1059 collating element is ignored; that is, as if the string did not contain the
1060 collating element. In regular expressions and pattern matching, all characters
1061 that are subject to \fBIGNORE\fR in their primary weight form an equivalence
1065 An empty operand is interpreted as the collating element itself.
1068 For example, the order statement:
1090 An ellipsis can be used as an operand if the collating element was an ellipsis,
1091 and is interpreted as the value of each character defined by the ellipsis.
1094 The collation order as defined in this section defines the interpretation of
1095 bracket expressions in regular expressions.
1105 \fBorder_start\fR \fBforward;backward\fR
1106 \fBUNDEFINED\fR \fBIGNORE;IGNORE\fR
1108 \fB<space>\fR \fB<LOW>;<space>\fR
1109 \fB\&.\|.\|.\fR \fB<LOW>;.\|.\|.\fR
1110 \fB<a>\fR \fB<a>;<a>\fR
1111 \fB<a-acute>\fR \fB<a>;<a-acute>\fR
1112 \fB<a-grave>\fR \fB<a>;<a-grave>\fR
1113 \fB<A>\fR \fB<a>;<A>\fR
1114 \fB<A-acute>\fR \fB<a>;<A-acute>\fR
1115 \fB<A-grave>\fR \fB<a>;<A-grave>\fR
1116 \fB<ch>\fR \fB<ch>;<ch>\fR
1117 \fB<Ch>\fR \fB<ch>;<Ch>\fR
1118 \fB<s>\fR \fB<s>;<s>\fR
1119 \fB<eszet>\fR \fB"<s><s>";"<eszet><eszet>"\fR
1125 This example is interpreted as follows:
1129 The \fBUNDEFINED\fR means that all characters not specified in this
1130 definition (explicitly or via the ellipsis) are ignored for collation purposes;
1131 for regular expression purposes they are ordered first.
1136 All characters between <\fBspace\fR> and <\fBa\fR> have the same primary
1137 equivalence class and individual secondary weights based on their ordinal
1143 All characters based on the upper- or lower-case character \fBa\fR belong to
1144 the same primary equivalence class.
1149 The multi-character collating element <\fBch\fR> is represented by the
1150 collating symbol <\fBch\fR> and belongs to the same primary equivalence class
1151 as the multi-character collating element <\fBCh\fR>.
1153 .SS "order_end \fIkeyword\fR"
1155 The collating order entries must be terminated with an \fBorder_end\fR keyword.
1158 The \fBLC_MONETARY\fR category defines the rules and symbols that are used to
1159 format monetary numeric information. This information is available through the
1160 \fBlocaleconv\fR(3C) function
1163 The following items are defined in this category of the locale. The item names
1164 are the keywords recognized by the \fBlocaledef\fR(1) utility when defining a
1165 locale. They are also similar to the member names of the \fBlconv\fR structure
1166 defined in <\fBlocale.h\fR>. The \fBlocaleconv\fR function returns
1167 \fB{CHAR_MAX}\fR for unspecified integer items and the empty string (\fB""\fR)
1168 for unspecified or size zero string items.
1171 In a locale definition file the operands are strings. For some keywords, the
1172 strings can contain only integers. Keywords that are not provided, string
1173 values set to the empty string (\fB""\fR), or integer keywords set to \fB-1\fR,
1174 are used to indicate that the value is not available in the locale.
1178 \fB\fBint_curr_symbol\fR\fR
1181 The international currency symbol. The operand is a four-character string, with
1182 the first three characters containing the alphabetic international currency
1183 symbol in accordance with those specified in the ISO 4217 standard. The fourth
1184 character is the character used to separate the international currency symbol
1185 from the monetary quantity.
1191 \fB\fBcurrency_symbol\fR\fR
1194 The string used as the local currency symbol.
1200 \fB\fBmon_decimal_point\fR\fR
1203 The operand is a string containing the symbol that is used as the decimal
1204 delimiter (radix character) in monetary formatted quantities.
1210 \fB\fBmon_thousands_sep\fR\fR
1213 The operand is a string containing the symbol that is used as a separator for
1214 groups of digits to the left of the decimal delimiter in formatted monetary
1221 \fB\fBmon_grouping\fR\fR
1224 Define the size of each group of digits in formatted monetary quantities. The
1225 operand is a sequence of integers separated by semicolons. Each integer
1226 specifies the number of digits in each group, with the initial integer defining
1227 the size of the group immediately preceding the decimal delimiter, and the
1228 following integers defining the preceding groups. If the last integer is not
1229 \fB-1\fR, then the size of the previous group (if any) will be repeatedly used
1230 for the remainder of the digits. If the last integer is \fB-1\fR, then no
1231 further grouping will be performed.
1233 The following is an example of the interpretation of the \fBmon_grouping\fR
1234 keyword. Assuming that the value to be formatted is \fB123456789\fR and the
1235 \fBmon_thousands_sep\fR is \fB\&'\fR, then the following table shows the
1236 result. The third column shows the equivalent string in the ISO C standard that
1237 would be used by the \fBlocaleconv\fR function to accommodate this grouping.
1241 mon_grouping Formatted Value ISO C String
1243 3;-1 123456'789 "\e3\e177"
1245 3;2;-1 1234'56'789 "\e3\e2\e177"
1246 3;2 12'34'56'789 "\e3\e2"
1247 -1 1234567898 "\e177"
1252 In these examples, the octal value of \fB{CHAR_MAX}\fR is 177.
1258 \fB\fBpositive_sign\fR\fR
1261 A string used to indicate a non-negative-valued formatted monetary quantity.
1267 \fB\fBnegative_sign\fR\fR
1270 A string used to indicate a negative-valued formatted monetary quantity.
1276 \fB\fBint_frac_digits\fR\fR
1279 An integer representing the number of fractional digits (those to the right of
1280 the decimal delimiter) to be written in a formatted monetary quantity using
1281 \fBint_curr_symbol\fR.
1287 \fB\fBfrac_digits\fR\fR
1290 An integer representing the number of fractional digits (those to the right of
1291 the decimal delimiter) to be written in a formatted monetary quantity using
1292 \fBcurrency_symbol\fR.
1298 \fB\fBp_cs_precedes\fR\fR
1301 In an application conforming to the SUSv3 standard, an integer set to \fB1\fR
1302 if the \fBcurrency_symbol\fR precedes the value for a monetary quantity with a
1303 non-negative value, and set to \fB0\fR if the symbol succeeds the value.
1305 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1306 \fB1\fR if the \fBcurrency_symbol\fR or \fBint_currency_symbol\fR precedes the
1307 value for a monetary quantity with a non-negative value, and set to \fB0\fR if
1308 the symbol succeeds the value.
1314 \fB\fBp_sep_by_space\fR\fR
1317 In an application conforming to the SUSv3 standard, an integer set to \fB0\fR
1318 if no space separates the \fBcurrency_symbol\fR from the value for a monetary
1319 quantity with a non-negative value, set to \fB1\fR if a space separates the
1320 symbol from the value, and set to \fB2\fR if a space separates the symbol and
1321 the sign string, if adjacent.
1323 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1324 \fB0\fR if no space separates the \fBcurrency_symbol\fR or
1325 \fBint_curr_symbol\fR from the value for a monetary quantity with a
1326 non-negative value, set to \fB1\fR if a space separates the symbol from the
1327 value, and set to \fB2\fR if a space separates the symbol and the sign string,
1334 \fB\fBn_cs_precedes\fR\fR
1337 In an application conforming to the SUSv3 standard, an integer set to \fB1\fR
1338 if the \fBcurrency_symbol\fR precedes the value for a monetary quantity with a
1339 negative value, and set to \fB0\fR if the symbol succeeds the value.
1341 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1342 \fB1\fR if the \fBcurrency_symbol\fR or \fBint_currency_symbol\fR precedes the
1343 value for a monetary quantity with a negative value, and set to \fB0\fR if the
1344 symbol succeeds the value.
1350 \fB\fBn_sep_by_space\fR\fR
1353 In an application conforming to the SUSv3 standard, an integer set to \fB0\fR
1354 if no space separates the \fBcurrency_symbol\fR from the value for a monetary
1355 quantity with a negative value, set to \fB1\fR if a space separates the symbol
1356 from the value, and set to \fB2\fR if a space separates the symbol and the sign
1357 string, if adjacent.
1359 In an application \fBnot\fR conforming to the SUSv3 standard, an integer set to
1360 \fB0\fR if no space separates the \fBcurrency_symbol\fR or
1361 \fBint_curr_symbol\fR from the value for a monetary quantity with a negative
1362 value, set to \fB1\fR if a space separates the symbol from the value, and set
1363 to \fB2\fR if a space separates the symbol and the sign string, if adjacent.
1369 \fB\fBp_sign_posn\fR\fR
1372 An integer set to a value indicating the positioning of the \fBpositive_sign\fR
1373 for a monetary quantity with a non-negative value. The following integer values
1374 are recognized for both \fBp_sign_posn\fR and \fBn_sign_posn\fR:
1376 In an application conforming to the SUSv3 standard:
1383 Parentheses enclose the quantity and the \fBcurrency_symbol\fR.
1392 The sign string precedes the quantity and the \fBcurrency_symbol\fR.
1401 The sign string succeeds the quantity and the \fBcurrency_symbol\fR.
1410 The sign string precedes the \fBcurrency_symbol\fR.
1419 The sign string succeeds the \fBcurrency_symbol\fR.
1422 In an application \fBnot\fR conforming to the SUSv3 standard:
1429 Parentheses enclose the quantity and the \fBcurrency_symbol\fR or
1430 \fBint_curr_symbol\fR.
1439 The sign string precedes the quantity and the \fBcurrency_symbol\fR or
1440 \fBint_curr_symbol\fR.
1449 The sign string succeeds the quantity and the \fBcurrency_symbol\fR or
1450 \fBint_curr_symbol\fR.
1459 The sign string precedes the \fBcurrency_symbol\fR or \fBint_curr_symbol\fR.
1468 The sign string succeeds the \fBcurrency_symbol\fR or \fBint_curr_symbol\fR.
1476 \fB\fBn_sign_posn\fR\fR
1479 An integer set to a value indicating the positioning of the \fBnegative_sign\fR
1480 for a negative formatted monetary quantity.
1486 \fB\fBint_p_cs_precedes\fR\fR
1489 An integer set to \fB1\fR if the \fBint_curr_symbol\fR precedes the value for a
1490 monetary quantity with a non-negative value, and set to \fB0\fR if the symbol
1497 \fB\fBint_n_cs_precedes\fR\fR
1500 An integer set to \fB1\fR if the \fBint_curr_symbol\fR precedes the value for a
1501 monetary quantity with a negative value, and set to \fB0\fR if the symbol
1508 \fB\fBint_p_sep_by_space\fR\fR
1511 An integer set to \fB0\fR if no space separates the \fBint_curr_symbol\fR from
1512 the value for a monetary quantity with a non-negative value, set to \fB1\fR if
1513 a space separates the symbol from the value, and set to \fB2\fR if a space
1514 separates the symbol and the sign string, if adjacent.
1520 \fB\fBint_n_sep_by_space\fR\fR
1523 An integer set to \fB0\fR if no space separates the \fBint_curr_symbol\fR from
1524 the value for a monetary quantity with a negative value, set to \fB1\fR if a
1525 space separates the symbol from the value, and set to \fB2\fR if a space
1526 separates the symbol and the sign string, if adjacent.
1532 \fB\fBint_p_sign_posn\fR\fR
1535 An integer set to a value indicating the positioning of the \fBpositive_sign\fR
1536 for a positive monetary quantity formatted with the international format. The
1537 following integer values are recognized for \fBint_p_sign_posn\fR and
1538 \fBint_n_sign_posn\fR:
1545 Parentheses enclose the quantity and the \fB\fR\fBint_curr_symbol\fR.
1554 The sign string precedes the quantity and the \fBint_curr_symbol\fR.
1563 The sign string precedes the quantity and the \fBint_curr_symbol\fR.
1572 The sign string precedes the \fBint_curr_symbol\fR.
1581 The sign string succeeds the \fBint_curr_symbol\fR.
1589 \fB\fBint_n_sign_posn\fR\fR
1592 An integer set to a value indicating the positioning of the \fBnegative_sign\fR
1593 for a negative monetary quantity formatted with the international format.
1598 The following table shows the result of various combinations:
1605 \fBp_sep_by_space\fR
1607 \fBp_cs_precedes\fR= 1 \fBp_sign_posn\fR= 0 \fB($1.25)\fR \fB($1.25)\fR \fB($1.25)\fR
1608 \fBp_sign_posn\fR= 1 \fB+$1.25\fR \fB+$1.25\fR \fB+$1.25\fR
1609 \fBp_sign_posn\fR= 2 \fB$1.25+\fR \fB$1.25+\fR \fB$1.25+\fR
1610 \fBp_sign_posn\fR= 3 \fB+$1.25\fR \fB+$1.25\fR \fB+$1.25\fR
1611 \fBp_sign_posn\fR= 4 \fB$+1.25\fR \fB$+1.25\fR \fB$+1.25\fR
1612 \fBp_cs_precedes\fR= 0 \fBp_sign_posn\fR= 0 \fB(1.25 $)\fR \fB(1.25 $)\fR \fB(1.25$)\fR
1613 \fBp_sign_posn\fR= 1 \fB+1.25 $\fR \fB+1.25 $\fR \fB+1.25$\fR
1614 \fBp_sign_posn\fR= 2 \fB1.25$ +\fR \fB1.25 $+\fR \fB1.25$+\fR
1615 \fBp_sign_posn\fR= 3 \fB1.25+ $\fR \fB1.25 +$\fR \fB1.25+$\fR
1616 \fBp_sign_posn\fR= 4 \fB1.25$ +\fR \fB1.25 $+\fR \fB1.25$+\fR
1621 The monetary formatting definitions for the POSIX locale follow. The code
1622 listing depicts the \fBlocaledef\fR(1) input, the table representing the same
1623 information with the addition of \fBlocaleconv\fR(3C) and \fBnl_langinfo\fR(3C)
1624 formats. All values are unspecified in the POSIX locale.
1629 # This is the POSIX locale definition for
1630 # the LC_MONETARY category.
1634 mon_decimal_point ""
1635 mon_thousands_sep ""
1647 int_p_cs_precedes -1
1648 int_p_sep_by_space -1
1649 int_n_cs_precedes -1
1650 int_n_sep_by_space -1
1661 The entry \fBn/a\fR indicates that the value is not available in the POSIX
1665 The \fBLC_NUMERIC\fR category defines the rules and symbols that will be used
1666 to format non-monetary numeric information. This information is available
1667 through the \fBlocaleconv\fR(3C) function.
1670 The following items are defined in this category of the locale. The item names
1671 are the keywords recognized by the \fBlocaledef\fR utility when defining a
1672 locale. They are also similar to the member names of the \fIlconv\fR structure
1673 defined in <\fBlocale.h\fR>. The \fBlocaleconv()\fR function returns
1674 \fB{CHAR_MAX}\fR for unspecified integer items and the empty string (\fB""\fR)
1675 for unspecified or size zero string items.
1678 In a locale definition file the operands are strings. For some keywords, the
1679 strings only can contain integers. Keywords that are not provided, string
1680 values set to the empty string (\fB""\fR), or integer keywords set to \fB-1\fR,
1681 will be used to indicate that the value is not available in the locale. The
1682 following keywords are recognized:
1686 \fB\fBdecimal_point\fR\fR
1689 The operand is a string containing the symbol that is used as the decimal
1690 delimiter (radix character) in numeric, non-monetary formatted quantities. This
1691 keyword cannot be omitted and cannot be set to the empty string. In contexts
1692 where standards limit the \fBdecimal_point\fR to a single byte, the result of
1693 specifying a multi-byte operand is unspecified.
1699 \fB\fBthousands_sep\fR\fR
1702 The operand is a string containing the symbol that is used as a separator for
1703 groups of digits to the left of the decimal delimiter in numeric, non-monetary
1704 formatted monetary quantities. In contexts where standards limit the
1705 \fBthousands_sep\fR to a single byte, the result of specifying a multi-byte
1706 operand is unspecified.
1712 \fB\fBgrouping\fR\fR
1715 Define the size of each group of digits in formatted non-monetary quantities.
1716 The operand is a sequence of integers separated by semicolons. Each integer
1717 specifies the number of digits in each group, with the initial integer defining
1718 the size of the group immediately preceding the decimal delimiter, and the
1719 following integers defining the preceding groups. If the last integer is not
1720 \fB\(mi1\fR, then the size of the previous group (if any) will be repeatedly
1721 used for the remainder of the digits. If the last integer is \fB-1\fR, then no
1722 further grouping will be performed. The non-monetary numeric formatting
1723 definitions for the POSIX locale follow. The code listing depicts the
1724 \fBlocaledef\fR input, the table representing the same information with the
1725 addition of \fBlocaleconv\fR values, and \fBnl_langinfo\fR constants.
1730 # This is the POSIX locale definition for
1731 # the LC_NUMERIC category.
1733 decimal_point "<period>"
1750 \fBPOSIX locale\fR \fBlanginfo\fR \fBlocaleconv()\fR \fBlocaledef\fR
1751 \fBItem\fR \fBValue\fR \fBConstant\fR \fBValue\fR \fBValue\fR
1753 \fBdecimal_point\fR \fB"."\fR \fBRADIXCHAR\fR \fB"."\fR \fB\&.\fR
1754 \fBthousands_sep\fR \fBn/a\fR \fBTHOUSEP\fR \fB""\fR \fB""\fR
1755 \fBgrouping\fR \fBn/a\fR \fB-\fR \fB""\fR \fB\(mi1\fR
1760 The entry \fBn/a\fR indicates that the value is not available in the POSIX
1764 The \fBLC_TIME\fR category defines the interpretation of the field descriptors
1765 supported by \fBdate\fR(1) and affects the behavior of the \fBstrftime\fR(3C),
1766 \fBwcsftime\fR(3C), \fBstrptime\fR(3C), and \fBnl_langinfo\fR(3C) functions.
1767 Because the interfaces for C-language access and locale definition differ
1768 significantly, they are described separately. For locale definition, the
1769 following mandatory keywords are recognized:
1776 Define the abbreviated weekday names, corresponding to the \fB%a\fR field
1777 descriptor (conversion specification in the \fBstrftime()\fR, \fBwcsftime()\fR,
1778 and \fBstrptime()\fR functions). The operand consists of seven
1779 semicolon-separated strings, each surrounded by double-quotes. The first string
1780 is the abbreviated name of the day corresponding to Sunday, the second the
1781 abbreviated name of the day corresponding to Monday, and so on.
1790 Define the full weekday names, corresponding to the \fB%A\fR field descriptor.
1791 The operand consists of seven semicolon-separated strings, each surrounded by
1792 double-quotes. The first string is the full name of the day corresponding to
1793 Sunday, the second the full name of the day corresponding to Monday, and so on.
1802 Define the abbreviated month names, corresponding to the \fB%b\fR field
1803 descriptor. The operand consists of twelve semicolon-separated strings, each
1804 surrounded by double-quotes. The first string is the abbreviated name of the
1805 first month of the year (January), the second the abbreviated name of the
1806 second month, and so on.
1815 Define the full month names, corresponding to the \fB%B\fR field descriptor.
1816 The operand consists of twelve semicolon-separated strings, each surrounded by
1817 double-quotes. The first string is the full name of the first month of the year
1818 (January), the second the full name of the second month, and so on.
1827 Define the appropriate date and time representation, corresponding to the
1828 \fB%c\fR field descriptor. The operand consists of a string, and can contain
1829 any combination of characters and field descriptors. In addition, the string
1830 can contain the escape sequences \e\e, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR,
1831 \fB\en\fR, \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1837 \fB\fBdate_fmt\fR\fR
1840 Define the appropriate date and time representation, corresponding to the
1841 \fB%C\fR field descriptor. The operand consists of a string, and can contain
1842 any combination of characters and field descriptors. In addition, the string
1843 can contain the escape sequences \fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR,
1844 \fB\en\fR, \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1853 Define the appropriate date representation, corresponding to the \fB%x\fR field
1854 descriptor. The operand consists of a string, and can contain any combination
1855 of characters and field descriptors. In addition, the string can contain the
1856 escape sequences \fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR,
1857 \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1866 Define the appropriate time representation, corresponding to the \fB%X\fR field
1867 descriptor. The operand consists of a string, and can contain any combination
1868 of characters and field descriptors. In addition, the string can contain the
1869 escape sequences \fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR,
1870 \fB\er\fR, \fB\et\fR, \fB\ev\fR\&.
1879 Define the appropriate representation of the \fIante meridiem\fR and \fIpost
1880 meridiem\fR strings, corresponding to the \fB%p\fR field descriptor. The
1881 operand consists of two strings, separated by a semicolon, each surrounded by
1882 double-quotes. The first string represents the \fIante meridiem\fR designation,
1883 the last string the \fIpost meridiem\fR designation.
1889 \fB\fBt_fmt_ampm\fR\fR
1892 Define the appropriate time representation in the 12-hour clock format with
1893 \fBam_pm\fR, corresponding to the \fB%r\fR field descriptor. The operand
1894 consists of a string and can contain any combination of characters and field
1895 descriptors. If the string is empty, the 12-hour format is not supported in the
1905 Define how years are counted and displayed for each era in a locale. The
1906 operand consists of semicolon-separated strings. Each string is an era
1907 description segment with the format:
1909 \fIdirection\fR:\fIoffset\fR:\fIstart_date\fR:\fIend_date\fR:\fIera_name\fR:\fIera_format\fR
1911 according to the definitions below. There can be as many era description
1912 segments as are necessary to describe the different eras.
1914 The start of an era might not be the earliest point For example, the Christian
1915 era B.C. starts on the day before January 1, A.D. 1, and increases with earlier
1920 \fB\fIdirection\fR\fR
1923 Either a \fB+\fR or a \fB-\fR character. The \fB+\fR character indicates that
1924 years closer to the \fIstart_date\fR have lower numbers than those closer to
1925 the \fIend_date\fR. The \fB-\fR character indicates that years closer to the
1926 \fIstart_date\fR have higher numbers than those closer to the \fIend_date\fR.
1935 The number of the year closest to the \fIstart_date\fR in the era,
1936 corresponding to the \fB%Eg\fR and \fB%Ey\fR field descriptors.
1942 \fB\fIstart_date\fR\fR
1945 A date in the form \fIyyyy\fR/\fImm\fR/\fBdd\fR, where \fIyyyy\fR, \fImm\fR,
1946 and \fBdd\fR are the year, month and day numbers respectively of the start of
1947 the era. Years prior to A.D. 1 are represented as negative numbers.
1953 \fB\fIend_date\fR\fR
1956 The ending date of the era, in the same format as the \fIstart_date\fR, or one
1957 of the two special values -* or +*. The value -* indicates that the ending date
1958 is the beginning of time. The value +* indicates that the ending date is the
1965 \fB\fIera_name\fR\fR
1968 A string representing the name of the era, corresponding to the \fB%EC\fR field
1975 \fB\fIera_format\fR\fR
1978 A string for formatting the year in the era, corresponding to the \fB%EG\fR and
1979 \fB%EY\fR field descriptors.
1987 \fB\fBera_d_fmt\fR\fR
1990 Define the format of the date in alternative era notation, corresponding to the
1991 \fB%Ex\fR field descriptor.
1997 \fB\fBera_t_fmt\fR\fR
2000 Define the locale's appropriate alternative time format, corresponding to the
2001 \fB%EX\fR field descriptor.
2007 \fB\fBera_d_t_fmt\fR\fR
2010 Define the locale's appropriate alternative date and time format, corresponding
2011 to the \fB%Ec\fR field descriptor.
2017 \fB\fBalt_digits\fR\fR
2020 Define alternative symbols for digits, corresponding to the \fB%O\fR field
2021 descriptor modifier. The operand consists of semicolon-separated strings, each
2022 surrounded by double-quotes. The first string is the alternative symbol
2023 corresponding with zero, the second string the symbol corresponding with one,
2024 and so on. Up to 100 alternative symbol strings can be specified. The \fB%O\fR
2025 modifier indicates that the string corresponding to the value specified via the
2026 field descriptor will be used instead of the value.
2029 .SS "LC_TIME \fIC-language\fR Access"
2031 The following information can be accessed. These correspond to constants
2032 defined in <\fBlanginfo.h\fR> and used as arguments to the
2033 \fBnl_langinfo\fR(3C) function.
2037 \fB\fBABDAY_\fIx\fR\fR\fR
2040 The abbreviated weekday names (for example Sun), where \fIx\fR is a number from
2047 \fB\fBDAY_\fIx\fR\fR\fR
2050 The full weekday names (for example Sunday), where \fIx\fR is a number from 1
2057 \fB\fBABMON_\fIx\fR\fR\fR
2060 The abbreviated month names (for example Jan), where \fIx\fR is a number from 1
2067 \fB\fBMON_\fIx\fR\fR\fR
2070 The full month names (for example January), where \fIx\fR is a number from 1 to
2080 The appropriate date and time representation.
2089 The appropriate date representation.
2098 The appropriate time representation.
2107 The appropriate ante-meridiem affix.
2116 The appropriate post-meridiem affix.
2122 \fB\fBT_FMT_AMPM\fR\fR
2125 The appropriate time representation in the 12-hour clock format with
2126 \fBAM_STR\fR and \fBPM_STR.\fR
2135 The era description segments, which describe how years are counted and
2136 displayed for each era in a locale. Each era description segment has the
2141 \fIdirection\fR:\fIoffset\fR:\fIstart_date\fR:\fIend_date\fR:\fIera_name\fR:\fIera_format\fR
2146 according to the definitions below. There will be as many era description
2147 segments as are necessary to describe the different eras. Era description
2148 segments are separated by semicolons.
2150 The start of an era might not be the earliest point For example, the Christian
2151 era B.C. starts on the day before January 1, A.D. 1, and increases with earlier
2156 \fB\fIdirection\fR\fR
2159 Either a + or a - character. The + character indicates that years closer to the
2160 \fIstart_date\fR have lower numbers than those closer to the \fIend_date\fR.
2161 The - character indicates that years closer to the \fIstart_date\fR have higher
2162 numbers than those closer to the \fIend_date\fR.
2171 The number of the year closest to the start_date in the era.
2177 \fB\fIstart_date\fR\fR
2180 A date in the form \fIyyyy\fR/\fImm\fR/\fIdd\fR, where \fIyyyy\fR, \fImm\fR,
2181 and \fBdd\fR are the year, month and day numbers respectively of the start of
2182 the era. Years prior to AD 1 are represented as negative numbers.
2188 \fB\fIend_date\fR\fR
2191 The ending date of the era, in the same format as the \fIstart_date\fR, or one
2192 of the two special values, \fB-*\fR or \fB+*\fR. The value \fB-*\fR indicates
2193 that the ending date is the beginning of time. The value \fB+*\fR indicates
2194 that the ending date is the end of time.
2200 \fB\fIera_name\fR\fR
2203 The era, corresponding to the \fB%EC\fR conversion specification.
2209 \fB\fIera_format\fR\fR
2212 The format of the year in the era, corresponding to the \fB%EY\fR and \fB%EY\fR
2213 conversion specifications.
2221 \fB\fBERA_D_FMT\fR\fR
2224 The era date format.
2230 \fB\fBERA_T_FMT\fR\fR
2233 The locale's appropriate alternative time format, corresponding to the
2234 \fB%EX\fR field descriptor.
2240 \fB\fBERA_D_T_FMT\fR\fR
2243 The locale's appropriate alternative date and time format, corresponding to the
2244 \fB%Ec\fR field descriptor.
2250 \fB\fBALT_DIGITS\fR\fR
2253 The alternative symbols for digits, corresponding to the \fB%O\fR conversion
2254 specification modifier. The value consists of semicolon-separated symbols. The
2255 first is the alternative symbol corresponding to zero, the second is the symbol
2256 corresponding to one, and so on. Up to 100 alternative symbols may be
2257 specified. The following table displays the correspondence between the items
2258 described above and the conversion specifiers used by \fBdate\fR(1) and the
2259 \fBstrftime\fR(3C), \fBwcsftime\fR(3C), and \fBstrptime\fR(3C) functions.
2269 \fBlocaledef\fR \fBlanginfo\fR \fBConversion\fR
2270 \fBKeyword\fR \fBConstant\fR \fBSpecifier\fR
2272 \fBabday\fR \fBABDAY_\fR\fIx\fR \fB%a\fR
2273 \fBday\fR \fBDAY_\fR\fIx\fR \fB%A\fR
2274 \fBabmon\fR \fBABMON_\fR\fIx\fR \fB%b\fR
2275 \fBmon\fR \fBMON\fR \fB%B\fR
2276 \fBd_t_fmt\fR \fBD_T_FMT\fR \fB%c\fR
2277 \fBdate_fmt\fR \fBDATE_FMT\fR \fB%C\fR
2278 \fBd_fmt\fR \fBD_FMT\fR \fB%x\fR
2279 \fBt_fmt\fR \fBT_FMT\fR \fB%X\fR
2280 \fBam_pm\fR \fBAM_STR\fR \fB%p\fR
2281 \fBam_pm\fR \fBPM_STR\fR \fB%p\fR
2282 \fBt_fmt_ampm\fR \fBT_FMT_AMPM\fR \fB%r\fR
2283 \fBera\fR \fBERA\fR \fB%EC, %Eg,\fR
2285 \fBera_d_fmt\fR \fBERA_D_FMT\fR \fB%Ex\fR
2286 \fBera_t_fmt\fR \fBERA_T_FMT\fR \fB%EX\fR
2287 \fBera_d_t_fmt\fR \fBERA_D_T_FMT\fR \fB%Ec\fR
2288 \fBalt_digits\fR \fBALT_DIGITS\fR \fB%O\fR
2291 .SS "LC_TIME \fIGeneral\fR Information"
2293 Although certain of the field descriptors in the POSIX locale (such as the name
2294 of the month) are shown with initial capital letters, this need not be the case
2295 in other locales. Programs using these fields may need to adjust the
2296 capitalization if the output is going to be used at the beginning of a
2300 The \fBLC_TIME\fR descriptions of \fBabday\fR, \fBday\fR, \fBmon\fR, and
2301 \fBabmon\fR imply a Gregorian style calendar (7-day weeks, 12-month years, leap
2302 years, and so forth). Formatting time strings for other types of calendars is
2303 outside the scope of this document set.
2306 As specified under \fBdate\fR in \fBLocale Definition\fR and
2307 \fBstrftime\fR(3C), the field descriptors corresponding to the optional
2308 keywords consist of a modifier followed by a traditional field descriptor (for
2309 instance \fB%Ex\fR). If the optional keywords are not supported by the
2310 implementation or are unspecified for the current locale, these field
2311 descriptors are treated as the traditional field descriptor. For instance,
2312 assume the following keywords:
2316 alt_digits "0th" ; "1st" ; "2nd" ; "3rd" ; "4th" ; "5th" ; \e
2317 "6th" ; "7th" ; "8th" ; "9th" ; "10th">
2318 d_fmt "The %Od day of %B in %Y"
2325 On 7/4/1776, the \fB%x\fR field descriptor would result in "The 4th day of July
2326 in 1776" while 7/14/1789 would come out as "The 14 day of July in 1789" The
2327 above example is for illustrative purposes only. The \fB%O\fR modifier is
2328 primarily intended to provide for Kanji or Hindi digits in \fBdate\fR formats.
2331 The \fBLC_MESSAGES\fR category defines the format and values for affirmative
2332 and negative responses.
2335 The following keywords are recognized as part of the locale definition file.
2336 The \fBnl_langinfo\fR(3C) function accepts upper-case versions of the first
2344 The operand consists of an extended regular expression (see \fBregex\fR(5))
2345 that describes the acceptable affirmative response to a question expecting an
2346 affirmative or negative response.
2355 The operand consists of an extended regular expression that describes the
2356 acceptable negative response to a question expecting an affirmative or negative
2366 The operand consists of a fixed string (not a regular expression) that can be
2367 used by an application for composition of a message that lists an acceptable
2368 affirmative response, such as in a prompt.
2377 The operand consists of a fixed string that can be used by an application for
2378 composition of a message that lists an acceptable negative response. The format
2379 and values for affirmative and negative responses of the POSIX locale follow;
2380 the code listing depicting the \fBlocaledef\fR input, the table representing
2381 the same information with the addition of \fBnl_langinfo()\fR constants.
2386 # This is the POSIX locale definition for
2387 # the LC_MESSAGES category.
2389 yesexpr "<circumflex><left-square-bracket><y><Y>\e
2390 <right-square-bracket>"
2392 noexpr "<circumflex><left-square-bracket><n><N>\e
2393 <right-square-bracket>"
2411 \fBlocaledef Keyword\fR \fBlanginfo Constant\fR \fBPOSIX Locale Value\fR
2412 \fByesexpr\fR \fBYESEXPR\fR \fB"^[yY]"\fR
2413 \fBnoexpr\fR \fBNOEXPR\fR \fB"^[nN]"\fR
2414 \fByesstr\fR \fBYESSTR\fR \fB"yes"\fR
2415 \fBnostr\fR \fBNOSTR\fR \fB"no"\fR
2420 In an application conforming to the SUSv3 standard, the information on
2421 \fByesstr\fR and \fBnostr\fR is not available.
2424 \fBdate\fR(1), \fBlocale\fR(1), \fBlocaledef\fR(1), \fBsort\fR(1), \fBtr\fR(1),
2425 \fBuniq\fR(1), \fBlocaleconv\fR(3C), \fBnl_langinfo\fR(3C),
2426 \fBsetlocale\fR(3C), \fBstrcoll\fR(3C), \fBstrftime\fR(3C), \fBstrptime\fR(3C),
2427 \fBstrxfrm\fR(3C), \fBwcscoll\fR(3C), \fBwcsftime\fR(3C), \fBwcsxfrm\fR(3C),
2428 \fBwctype\fR(3C), \fBattributes\fR(5), \fBcharmap\fR(5), \fBextensions\fR(5),