locale(M)


locale -- the international locale

Syntax

[language[_territory][.codeset][@modifier]]

Description

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:

  1. For each locale category, such as LC_TIME, in an environment variable of the same name.

  2. In the LANG environment variable.

  3. 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.

For example, /etc/default/lang might contain:

   LANG=en_US.ascii
   LANG=en_GB.ISO8859-1
   LANG=fr_FR.ISO8859-1
   LANG=fr_CA.ISO8859-1
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)).

Converting locale definitions

For backward compatibility, the utilities chrconv(M), colconv(M), mesconv(M), monconv(M), numconv(M) and timconv(M) are provided to convert the chrtbl(M), coltbl(M), mestbl(M), montbl(M), numtbl(M) and timtbl(M) locale definition files.

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:

Old locale name New locale name
english_uk.8859 en_GB.ISO8859-1
english_us.8859 en_US.ISO8859-1
english_us.ascii en_US.ascii
french_france.8859 fr_FR.ISO8859-1
german_germany.8859 de_DE.ISO8859-1
portuguese_brazil.8859 pt_BR.ISO8859-1
spanish_spain.8859 es_ES.ISO8859-1

 +-----------------------+-----------------+
 |Old locale name        | New locale name |
 +-----------------------+-----------------+
 |english_uk.8859        | en_GB.ISO8859-1 |
 +-----------------------+-----------------+
 |english_us.8859        | en_US.ISO8859-1 |
 +-----------------------+-----------------+
 |english_us.ascii       | en_US.ascii     |
 +-----------------------+-----------------+
 |french_france.8859     | fr_FR.ISO8859-1 |
 +-----------------------+-----------------+
 |german_germany.8859    | de_DE.ISO8859-1 |
 +-----------------------+-----------------+
 |portuguese_brazil.8859 | pt_BR.ISO8859-1 |
 +-----------------------+-----------------+
 |spanish_spain.8859     | es_ES.ISO8859-1 |
 +-----------------------+-----------------+

See also

ascii(M), chrconv(M), chrtbl(M), colconv(M), coltbl(M), environ(M), locale(C), localedef(C), localedef(F), mesconv(M), mestbl(M), monconv(M), montbl(M), numconv(M), numtbl(M), setlocale(S), timconv(M), timtbl(M)

Standards conformance

locale is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
X/Open CAE Specification, System Interface Definitions, Issue 4, 1992.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005