This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Select a program's locale
#include <locale.h> char * setlocale( int category, const char * locale );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The setlocale() function selects a program's locale, according to the specified category and the specified locale.
A locale affects several things:
See the localeconv() function for more information about the locale.
At the start of a program, the default C locale is initialized as if the following call to setlocale() appeared at the start of main():
(void)setlocale( LC_ALL, "C" );
A pointer to a system-generated string indicating the previous locale, or NULL if an error occurs.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
isalpha(), isascii(), localeconv(), printf(), scanf(), strcat(), strchr(), strcmp(), strcoll(), strcpy(), strftime(), strlen(), strpbrk(), strspn(), strtod(), strtok(), strxfrm(), tm