Locales are defined through the specification of a locale definition file. The locale definition contains one or more distinct locale category source definitions and not more than one definition of any category. Each category controls specific aspects of the cultural environment. A category source definition is either the explicit definition of a category or the copy directive, which indicates that the category definition should be copied from another locale definition file.
ASCII locales must be specified using only the characters from the portable character set, and all character references must be symbolic names, not explicit code point values.
escape_char <character>
comment_char <character>
escape_char /
Locale definition files passed to the localedef utility are assumed to be in coded character set IBM-1047.
escape_char /
comment_char %
This suggested redefinition is used in all locale definition files supplied by IBM. For reasons of portability, you should use the suggested redefinition in all your customized locale definition files. See Customizing a locale for information about customizing locales. These two redefinitions should be placed in the first lines of the locale definition source file, before any of the redefined characters are used.
The LC_TOD and LC_SYNTAX categories, if present, must be the last two categories in the locale definition file.
<identifier> <operand1>
<identifier> <operand1>;<operand2>;...;<operandN>
<identifier> is
a keyword that identifies a locale element, or a symbolic name that
identifies a collating element. <operand> is a character,
collating element, or string literal. Escape sequences can be specified
in a string literal using the <escape_character>. If
multiple operands are specified, they must be separated by semicolons.
White space can be before and after the semicolons.Figure 1 is an example of locale source containing the header, body, and trailer.
escape_char /
comment_char %
%
% Here is a simple locale definition file consisting of one
% category source definition, LC_CTYPE.
%
LC_CTYPE
upper <A>;...;<Z>
END LC_CTYPE
You do not have to define each category. Where category definitions are absent from the locale source, default definitions are used.
In each category, the keyword copy followed by a string specifies the name of an existing locale to be used as the source for the definition of this category.
If the locale is not found, an error is reported and no locale output is created.
For the batch (EDC(X)LDEF proc) and TSO (LOCALDEF) commands, the name must be the member name of a partitioned data set allocated to the EDCLOCL DD statement. For the UNIX System Services localedef command, the copy keyword specifies the path name of the source file.
You can continue a line in a locale definition file by placing an escape character as the last character on the line. This continuation character is discarded from the input. Even though there is no limitation on the length of each line, for portability reasons it is suggested that each line be no longer than 2048 characters (bytes). There is no limit on the accumulated length of a continued line. You cannot continue comment lines on a subsequent line by using an escaped <newline>.
Individual characters, characters in strings, and collating elements are represented using symbolic names, as defined below. Characters can also be represented as the characters themselves, or as octal, hexadecimal, or decimal constants. If you use non-symbolic notation, the resultant locale definition file may not be portable among systems and environments. The left angle bracket (<) is a reserved symbol, denoting the start of a symbolic name; if you use it to represent itself, you must precede it with the escape character.
If the character represented by the symbolic name is a multibyte character defined by 2 byte values in the charmap file, and the shift-out and shift-in characters are defined, the value is enclosed within shift-out and shift-in characters before the localedef utility processes it any further.
For example: \131 "\212\129\168" \16\66\193\17
For example: \x83 "\xD4\x81\xA8"
For example: \d131 "\d212\d129\d168" \d14\d66\d193\d15
For multibyte characters, the entire encoding sequence, including the shift-out and shift-in characters, must be present. Otherwise, the sequence of bytes not enclosed between the shift-out and shift-in characters are interpreted as a sequence of single byte characters.
Multibyte characters can be represented by concatenating constants specified in byte order with the last constant specifying the least significant byte of the character. If the sequence of octal, hexadecimal, or decimal constants is to represent a multibyte character, it must be enclosed in shift-out and shift-in constants. For example: \x0e\x42\xC1\x0f