setlocale()

NAME

setlocale() - set or query the program's locale

SYNOPSIS

#include <locale.h>

char * setlocale(int category, const char *locale)

DESCRIPTION

The setlocale(3) function changes or queries the program's locale. The category is used to specify part of the locale. It can have any one of these values (defined in <locale.h>):

LC_ALL The entire locale
LC_COLLATE Character collating sequence
LC_CTYPE Character handling and multibyte functions
LC_MONETARY Monetary formatting information
LC_NUMERIC Decimal point character in I/O and string conversions
LC_TIME Time formatting -- see strftime()

The locale argument is a string naming a particular locale. All POSIX-conforming systems support the locales "C" and "POSIX". Up to and including release 2.0, INTERIX supports only the C and POSIX locales.

To query the current locale, use a null string ("") as the locale. setlocale(3) returns the name of the current locale for that category.

The return value may be overwritten by a subsequent call to setlocale(3), so your program shouldn't modify it.

RETURN VALUE

On success, the setlocale(3) function returns a string that corresponds to the locale specified by locale. If the function fails, it returns NULL.

SEE ALSO

isalnum(3)

isalpha(3)

iscntrl(3)

isgraph(3)

islower(3)

isprint(3)

ispunct(3)

isspace(3)

isupper(3)

localeconv(3)

strcoll(3)

strftime(3)

strxfrm(3)