HP C/iX Library Reference Manual (30026-90004)

308 Chapter5
HP C/iX Library Function Descriptions
setlocale
—Iflocale is not specified (an empty string is used), as in the following example,
setlocale (category,"")
the locale is set according to the following scheme:
1. If an equivalent 'LC_' environment variable is set, the language is set to the
language specified by the variable.
2. If the environment variable LANG is set, the language is set as specified by LANG.
3. If the JCW NLUSERLANG or NLDATALANG is set:
—ForLC_COLLATE and LC_TYPE, the language is set as specified by NLDATALANG.
—ForLC_TIME, LC_MONETARY and LC_NUMERIC, the language is set as specified by
NLUSERLANG.
Otherwise, locale is set to be the C-locale.
When Locale is Null
If the locale is a null pointer, the setlocale function returns the current locale of
the named category to the program. For example,
setlocale (LC_MONETARY,NULL);
returns to the program the locale that is set for monetary processing. This is a query
operation that does not change the locale environment of the program.
NOTE
The default locale is always the C-locale.
See Also
localeconv(), ANSI C 4.4.1.1, POSIX.1 8.1.2