The international locale is a definition of the local conventions
to be used by UNIX libraries (and hence utilities and applications)
for features whose behavior varies internationally.
The locale is specified by a character string of the form shown in
the ``Syntax'' section:
language
Represents both the language of text files being used, and the
preferred language for messages (where the utility or application
is capable of displaying messages in many languages).
territory
Represents the geographical location (usually the country)
determining such factors as currency and numeric formats.
codeset
Represents the character set in use for the internal representation
of text.
modifier
Specifies a special instance of a localization; for example,
selecting dictionary order of data instead of character order.
The locale string ``fr_CA.ISO8859-1'' could therefore represent
a Canadian user using the French language, processing data using the
ISO 8859-1 standard international codeset (see the
section
``New locale naming convention'').
Note that the locale is not required to be completely specified;
territory, codeset, and modifier are optional.
When a locale is incompletely specified, missing values are sought in the
following sequence:
For each locale category, such as LC_TIME,
in an environment variable of the same name.
In the LANG environment variable.
In the defaults file /etc/default/lang.
Default locales
The format of the file /etc/default/lang
contains at least one line, of the form:
LANG="language_territory.codeset"
A partly specified locale string will be expanded to the first
LANG= entry in which the specified locale fields match.
A locale string ``en_GB'' would then be expanded to
``en_GB.ISO8859-1''; whereas ``fr'' would
become ``fr_FR.ISO8859-1''.
The POSIX locale
The special locale string ``POSIX'' (or its equivalent,
``C'') is used to represent the default locale. It is
also the default environment set for the C programming
language when the
setlocale(S)
function has not been called.
Defining locales
The information used to configure a particular locale is generated by the
localedef(C)
utility from locale definitions files (the format of these is defined in
localedef(F)).
The output files
(ctype, collate, currency, messages,
numeric, and time)
produced by
localedef
or these utilities must be installed in the correct places in the directory
structure /usr/lib/lang.
The correct directory name is found by substituting the language, territory
and codeset names into the string ``/usr/lib/lang/language/territory/codeset''.
The files should be installed into this directory with their standard
filename (such as ctype).
New locale naming convention
The new locale naming convention is:
language
A 2-letter code for the name of the language
(according to ISO 639), such as:
``en'' for English, ``fr'' for French, and
``de'' for German.
territory
A 2-letter code for the name of the country
(according to ISO 3166), such as:
``US'' for the United States of America,
``FR'' for France,
``DE'' for Germany,
and ``CH'' for Switzerland.
codeset
An identification name for the codeset
(according to the X Consortium Font Charset (Registry and
Encoding) Names convention), such as:
``ascii'' for 7-bit ASCII, and ``ISO8859-2''
for the ISO 8859-2 character set.
modifier
A code for a style category of localization data, such as:
``dict'' for dictionary order, and ``char'' for character order.
The locale string should use only alphanumeric portable
characters for language, territory,
codeset, and modifier, the delimiter
characters ``_'' and ``.'', ``-'' within
codeset, and ``@''.
Traditional SCO OpenServer locale naming
In earlier releases, SCO OpenServer used full names when specifying locales.
In this release, the X/Open naming convention for locales
has been implemented as described in
``New locale naming convention''.
To retain backward compatibility, both old and new locales
are provided in the /usr/lib/lang hierarchy using
symbolic links to point to the same locale files. The following
table shows the correspondence between the old and new
locale naming conventions: