#include #include int main () { locale_t C = newlocale(LC_ALL_MASK, "C", (locale_t) 0); locale_t P; fprintf(stderr, "LC_COLLATION after making C is %s\n", querylocale(LC_COLLATE_MASK, C)); P = newlocale(LC_ALL_MASK, "POSIX", (locale_t) 0); /* Creating a new locale from scratch should have no effect on an existing * one. LC_COLLATE seems to be the only broken category */ fprintf(stderr, "LC_COLLATION should remain C, but instead is %s\n", querylocale(LC_COLLATE_MASK, C)); fprintf(stderr, "LC_CTYPE should remain C, and in fact is %s\n", querylocale(LC_CTYPE_MASK, C)); fprintf(stderr, "LC_NUMERIC should remain C, and in fact is %s\n", querylocale(LC_NUMERIC_MASK, C)); fprintf(stderr, "LC_MONETARY should remain C, and in fact is %s\n", querylocale(LC_MONETARY_MASK, C)); fprintf(stderr, "LC_MESSAGES should remain C, and in fact is %s\n", querylocale(LC_MESSAGES_MASK, C));