The setlocale library function that selects the active locale maps the descriptive locale name into the name of the locale object before loading the locale and making it accessible.
In IBM C and C++ Compilers programs, the locale modules are referred to by descriptive locale names. The locale names themselves are not case sensitive. The names have three parts and follow the format:
<Language>_<Territory>.<Codeset>
The parts of a locale name are:
| Language | is a two-letter abbreviation for the language name. The abbreviations come from the ISO 639 standard. |
| Territory | is a two-letter abbreviation for the territory name. The abbreviation comes from the ISO 3166 standard. |
| Codeset | is the name registered by
the MIT X Consortium that identifies the registration
authority that owns the specific encoding. A modifier may be added to the registered name but is not required. The modifier is of the form @modifier and identifies the coded character set as defined by that registration authority. Note: On FAT file systems, the modifier cannot be used as it causes the filename to exceed the 8 character FAT filename limit. |
The Codeset parts are optional. If they are not specified, Codeset defaults to IBM-nnn, where nnn is the current code page. (The modifier portion defaults to nothing.)
The setlocale function tries to load the locale as follows:
The LOCALDEF utility processes the locale name parameter to produce a filename suitable for use with the FAT file system as follows:
language_territory\codeset.lcl
language_territory.lcl
language_territory\codeset.lcl
The exceptions to the rule above are these two special locale names, which are already recognized:
![]()
Internationalization
Localization
and Locales
![]()
Locale Categories
Locales Provided on Windows
Locales Provided on OS/2