Definition | #include <locale.h> char *setlocale(int category, const char *locale); With |
Parameters
int category
Category of locale variables to which the selected locale is to refer. category may contain the following predefined values:
LC_ALL LC_COLLATE | Locale variables of all categories. The sorting sequence affects the behavior of the |
LC_CTYPE | The character type affects the behavior of the macros for character |
LC_MONETARY | The conventions for representing monetary values affect the values |
LC_NUMERIC | The conventions for representing non-monetary numerical values affect |
LC_TIME | The conventions for representing date and time affect the behavior of |
Definition | #include <locale.h> char *setlocale(int category, const char *locale); With | |||||||||||||||||||||||||||||||||||||||||
Parameters | int category Category of locale variables to which the selected locale is to refer. category may contain the following predefined values:
const char *locale String which selects the locale. The following predefined locales are available (a detailed description is provided in section “Predefined locale C”):
The strings are predefined in the include file <locale.h> as follows:
If a NULL pointer is passed for locale, the current locale for category is not changed. | |||||||||||||||||||||||||||||||||||||||||
Return val. | Pointer to a string specifying the current locale for the specified category. | |||||||||||||||||||||||||||||||||||||||||
This string can be used as the locale parameter in setlocale calls. The string can assume the following values: If a string containing the locales for all categories is used as the locale parameter in a setlocale call and a category other than LC_ALL is specified, only the locale for the specified category is taken from this string (without the leading slash). Example of the return value for LC_ALL:
| ||||||||||||||||||||||||||||||||||||||||||
NULL pointer | if the selected category cannot be recognized. The current locale remains unchanged. | |||||||||||||||||||||||||||||||||||||||||
Notes | The available locales are described in detail in chapter “Locale”. User-specific locales: The string to which the return value of setlocale points must not be explicitly changed by the program. It may only be overwritten by If you are only querying the current locale and not changing it, a NULL pointer must be passed for locale. | |||||||||||||||||||||||||||||||||||||||||
See also | localeconv |