Specifically, on UNIX systems the setlocale() function should be used to first initialize the program's running locale settings in accordance with its environment, then the same function should be used to get locale settings for specific category:
/* Sample program */
#include <locale.h>
#include <stdio.h>
Specifically, on UNIX systems the setlocale() function should be used to first initialize the program's running locale settings in accordance with its environment, then the same function should be used to get locale settings for specific category:
/* Sample program */
#include <locale.h>
#include <stdio.h>
int main() { "LC_MEASUREMENT : %s\n", setlocale( LC_MEASUREMENT, NULL)); "LC_IDENTIFICAT ION: %s\n", setlocale( LC_IDENTIFICATI ON, NULL));
printf("LC_ALL: %s\n", setlocale(LC_ALL, NULL));
printf("LC_CTYPE: %s\n", setlocale(LC_CTYPE, NULL));
printf(
printf(
/* Initialize program's locale: */
printf("LC_ALL: %s\n", setlocale(LC_ALL, ""));
printf("LC_ALL: %s\n", setlocale(LC_ALL, NULL)); "LC_MEASUREMENT : %s\n", setlocale( LC_MEASUREMENT, NULL)); "LC_IDENTIFICAT ION: %s\n", setlocale( LC_IDENTIFICATI ON, NULL));
printf("LC_CTYPE: %s\n", setlocale(LC_CTYPE, NULL));
printf(
printf(
return 0;
}
/* End sample */
More details:
http:// www.opengroup. org/onlinepubs/ 009695399/ functions/ setlocale. html