Set or retrieve locale.
Sets locale information to be used by the current program, either changing the entire locale or portions of it. The function can also be used to retrieve the current locale's name by passing NULL as the value for argument locale.
- Parameters
-
category | Portion of the locale affected (LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME). |
locale | C string containing the name of a C locale. |
- Returns
- On success, A pointer to a C string identifying the locale currently set for the category. If category is LC_ALL and different portions of the locale are set to different values, the string returned gives this information in a format which may vary between library implementations. If the function failed to set a new locale, this is not modified and a null pointer is returned.