Select a Locale
To select a locale category during program
execution, call the setlocale function. This function has two arguments:
- category specifies the locale category. The LC
environment variables that match the names of locale categories are:
- LC_ALL
- LC_COLLATE
- LC_CTYPE
- LC_MESSAGES
- LC_MONETARY
- LC_NUMERIC
- LC_TIME
- LC_TOD
- LC_SYNTAX
- locale is the
name of the locale from which to take the value for the
category. You can use this argument in the following
ways:
- Pass NULL as the locale name
string to tell the function to query the current
locale without modifying it.
- Pass an empty string to set the
current locale as specified by the LC environment
variable. If the environment variable isn't set,
the current locale is set to the default POSIX C
locale.
- Specify the name of a locale,
either language_territory or fully qualified,
with the code page name. For example,
en_US.IBM.437.
Example: Select a Locale Explicitly by name
Example: Select a Locale Using Environment Variables

Internationalization

Make Your Program
International
Customize a Locale
Convert Character
Coding

Locale-Sensitive
Interfaces
Locale Naming
Conventions
Locales
Provided on OS/2
Locales
Provided on Windows