[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

National Language Support Guide and Reference

Understanding Locale

A locale comprises the language, territory, and code set combination used to identify a set of language conventions. These conventions include information on collation, case conversion, and character classification, the language of message catalogs, date-and-time representation, the monetary symbol, and numeric representation.

Locale information contained in the locale definition source files must first be converted into a locale database by the localedef command. The setlocale subroutine can then access this information and set locale information for applications. To deal with locale data in a logical manner, locale definition source files are divided into six categories. Each category contains a specific aspect of the locale data. The LC_* environment variables and the LANG environment variable can be used to specify the desired locale. For more information on locale categories, see Understanding Locale Categories.

Typical User Scenarios

Users might encounter several NLS-related scenarios on the system. This section lists common scenarios with suggested actions to be taken.

Locale Naming Conventions

Each locale is named by its locale definition source file name. These files are named for the language, territory, and code set information they describe. The following format is used for naming a locale definition file:

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

For example, the locale for the Danish language spoken in Denmark using the ISO8859-1 code set is da_DK.ISO8859-1. The da stands for the Danish language and the DK stands for Denmark. The short form of da_DK is sufficient to indicate this locale. The same language and territory using the ISO8859-15 code set is indicated by da_DK.8859-15.

System-defined locale definition files are provided to show the format of locale categories and their keywords. The /usr/lib/nls/loc directory contains the locale definition files for system-defined locales. The C, or POSIX, locale defines the ANSI C-defined standard locale inherited by all processes at startup time. To obtain a list of system-defined locale definition source files, enter the following on the command line:

/usr/lib/nls/lsmle -c

Installation Default Locale

The installation default locale refers to the locale selected at installation. For example, when prompted, a user can specify the French language as spoken in Canada during the installation process. The code set automatically defaults to the ISO8859-1 code set. With this information, the system sets the value of the default locale, specified by the LANG environment variable, to fr_CA (fr for ISO8859-1 French and CA for Canada). Every process uses this locale unless the LC_* or LANG environment variables are modified. The default locale can be changed by using the Manage Language Environment menu in SMIT. For more information see System Management Interface Tool (SMIT) Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices.

The C or POSIX Locale

This locale refers to the ANSI C or POSIX-defined standard for the locale inherited by all processes at startup time. The C or POSIX locale assumes the 7-bit ASCII character set and defines information for the six previous categories.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]