◐ Shell
clean mode source ↗

Message 214556 - Python tracker

With the following C code:

#include <locale.h>
#include <stdio.h>

int main(void)
{
	char* res = setlocale(LC_CTYPE, "UTF-8");
	printf("Result: %s\n", res);

	res = setlocale(LC_CTYPE, "UTF-9");
	printf("Result: %s\n", res);
	return 0;
}
/* EOF */

I get the following output:

Result: UTF-8
Result: (null)

That is, UTF-8 is a valid locale for LC_CTYPE, and as expected some other string isn't.

BTW. "UTF-8" is only a valid locale for LC_CTYPE, not for other categories (when you change LC_CTYPE to LC_ALL both calls return NULL).