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

National Language Support Guide and Reference

Understanding Locale Environment Variables

National Language Support (NLS) uses several environment variables to influence the selection of locales. You can set the values of these variables to change search paths for locale information:

Specifies the installation default locale.
The LANG environment variable value is established at installation. (This is the locale every process uses unless the LC_* environment variables are set). The LANG environment variable can be changed by using the Manage Language Environment menu in SMIT. For more information about using SMIT, see System Management Interface Tool (SMIT) Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices. The C and POSIX locales are designed to offer the best performance.
Overrides the value of the LANG environment variable and the values of any other LC_* environment variables.
Specifies the locale to use for LC_COLLATE category information. The LC_COLLATE category determines character-collation or string-collation rules governing the behavior of ranges, equivalence classes, and multicharacter collating elements.
Specifies the locale to use for LC_CTYPE category information. The LC_CTYPE category determines character handling rules governing the interpretation of sequences of bytes of text data characters (that is, single-byte versus multibyte characters), the classification of characters (for example, alpha, digit, and so on), and the behavior of character classes.
Specifies that default messages are used for the C and POSIX locales and that NLSPATH are ignored when LC__FASTMSG is set to true. Otherwise, POSIX compliant message handling will be performed. The default value will be LC__FASTMSG=true in the /etc/environment file.
Specifies the locale to use for LC_MESSAGES category information. The LC_MESSAGES category determines rules governing affirmative and negative responses and the locale (language) for messages and menus.
Specifies the locale to use for LC_MONETARY category information. The LC_MONETARY category determines the rules governing monetary-related formatting.
Specifies the locale to use for LC_NUMERIC category information. The LC_NUMERIC category determines the rules governing nonmonetary numeric formatting.
Specifies the locale to use for LC_TIME category information. The LC_TIME category determines the rules governing date and time formatting.
Specifies the search path for localized information, including binary locale files, input methods, and code-set converters.
All setuid and setgid programs ignore the LOCPATH environment variable.
Specifies the search path for locating message catalog files. This environment variable is used by the Message Facility component of the NLS subsystem. See the catopen subroutine for more information about expected format of the NLSPATH variable.

The environment variables that affect locale selection can be grouped into three priority classes: high, medium, and low. Environment variables in the high priority class are:

Environment variables in the medium priority class are:

The environment variable in the low priority class is:

When a locale is requested by the setlocale subroutine for a particular category or for all categories, the environment variable settings are queried by their priority level in the following manner:

Environment Variables Precedence Example

The following table shows the current setting of the environment variables and the effect of calling setlocale(LC_ALL,""). The last column indicates the locale setting after setlocale(LC_ALL,"") is called.

Environment Variable and Category Names Value of Environment Variables Value of Category After Call To setlocale(LC_ALL,"")
LC_NUMERIC (unset) da_DK
LC_TIME (unset) da_DK
LC_MESSAGES (unset) da_DK
LC_ALL (unset) (not applicable)
LANG da_DK (not applicable)

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