This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: "C" UTF-8 trouble
2009/10/6 Corinna Vinschen:
> The problem is what do we do? ÂPOSIX requires that the default
> locale is "C".
Agreed, we can't change that.
>ÂDo you actually propose to change the environment at
> process startup
Yes, except that I was thinking it would be sufficient to do this at
the start of a Cygwin process tree only, and not for every process.
> along these lines:
>
> Âif (!getenv ("LC_ALL") && !getenv ("LC_CTYPE", && !getenv ("LANG"))
> Â Âsetenv ("LC_CTYPE", "C.UTF-8", 0);
This would do:
setenv ("LANG", "C.UTF-8", 0);
Zero as the third parameter ensures that an existing LANG isn't
overwritten. And if LC_ALL or LC_CTYPE are set, they override LANG
anyway.
Andy