Locale subroutines

Programs that perform locale-dependent processing, including user messages, must call the setlocale subroutine at the beginning of the program. This call is the first executable statement in the main program. Programs that do not call the setlocale subroutine in this way inherit the C or POSIX locale. Such programs perform as in the C locale, regardless of the setting of the LC_* and LANG environment variables.

Other subroutines are provided to determine the current settings for locale data formatting.

The locale of a process determines the way that character collation, character classification, date and time formatting, numeric punctuation, monetary punctuation, and message output are handled. The following section describes how to set and access information about the current locale in a program by using multicultural support.