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.