previous next contents
Locale Categories

category - a set of I18N features all presented to the user in the same locale. One of the following: LC_COLLATE, LC_CTYPE, LC_TIME, LC_NUMERIC, LC_MONETARY, and LC_MESSAGES.

locale category - same as category.

The concept of categories allows better organization of locale information and the implementation of mixed language environments.

single language environment - environment in which all I18N features of a program are presented in the same locale.

mixed language environment - environment in which some I18N features of a program are presented in one locale and other I18N features of the same program are presented in another locale.

Implementations are free to introduce new categories.

The locale settings of individual categories may not be truly independent, especially in the area of codesets.

LC_COLLATE - category which encapsulates the I18N features corresponding to character collation. The value of the locale associated with LC_COLLATE affects mbscmp(), mbsncmp(), strcoll(), strxfrm(), wcscoll(), and wcsxfrm().

LC_CTYPE - category which encapsulates the I18N features corresponding to character classification. The value of the locale associated with LC_CTYPE affects fgetwc(), fgetws(), fputwc(), fputws(), getwc(), getwchar(), get_wctype(), getws(), is_wctype(), is*(), isw*(), mblen(), mbsadvance(), mbschr(), mbsinvalid(), mbsncat(), mbsncmp(), mbsncpy(), mbspbrk(), mbsrchr(), mbstowcs(), mbswidth(), mbtowc(), printf(), putwc(), putwchar(), putws(), scanf(), towlower(), towupper(), ungetwc(), wcstod(), wcstol(), wcstombs(), wcstoul(), wcswidth(), wctomb(), wcwidth().

LC_MONETARY - category which encapsulates the I18N features corresponding to monetary information. The value of the locale associated with LC_MONETARY affects strfmon(). The LC_MONETARY information is stored in the lconv structure, which can be returned by calling localeconv().

LC_NUMERIC - category which encapsulates the I18N features corresponding to the display of numeric quantities. The value of the locale associated with LC_NUMERIC affects printf(), scanf(), strtod(), atof(). The LC_NUMERIC information is stored in the lconv structure, which can be returned by calling localeconv().

LC_TIME - category which encapsulates the I18N features corresponding to the display of date and time. The value of the locale associated with LC_TIME affects strftime(), strptime(), wcsftime().

LC_MESSAGES - category which encapsulates the I18N features corresponding to messages presented to the user including error messages, prompts, status messages, titles of display windows, labels of buttons, etc. It also governs the behavior of functions which process affirmative and negative responses from the user. The value of the locale associated with LC_MESSAGES affects strerror(), catopen().

LC_MESSAGES is defined by POSIX.2 and X/Open, but not by POSIX.1. Therefore, setlocale() is not required to support it. However, most implementations will ensure that setlocale() does support LC_MESSAGES.

category environment variable - environment variable, associated with a category and having the same name as that category, whose value is the locale associated with the category.


previous next contents