I'm programming in C and want any UTF (i.e., “ru_RU-UTF-8″, “en_EN-UTF-8″, etc.) to all go ahead and convert to the wchar_t
version (using the mbrtowc
function). It doesn't even matter which wchar_t
it converts to particularly, as long as it's a valid wchar_t
in some local.
Is there a “UTF-8-whatever” setting I can pass to locale?
Like I’m looking for the exact opposite of setlocale("POSIX")
/ setlocale("C")
.
To clarify, the C code...
setlocale(LC_ALL, "ru_RU.UTF-8");
stuff = mbrtowc(..... )
works, where the C code...
setlocale(LC_ALL, "en_US.UTF-8");
stuff = mbrtowc(..... )
returns -1
as soon as it hits Cyrillic. The stuff I'm dealing with also might have Japanese characters, etc...