This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: "C" character set (again)
2010/1/10 Corinna Vinschen:
>> Was that the only change you applied? ÂAre you aware that this also
>> requires to revert the changes to libc/stdlib/mbtowc_r.c and
>> libc/stdlib/wctomb_r.c which set the function pointers __mbtowc to
>> __utf8_mbtowc and __wctomb to __utf8_wctomb on Cygwin?
D'oh. I was (in the past), but didn't remember it this time round ...
> Boy, that's tricky. ÂIf this change gets reverted, the initial
> environment is converted to ASCII, rather than UTF-8. ÂThis very change
> was what allowed to remove the special code to fetch the LC_xxx vars
> from the Windows environment before converting the environment.
... which is why the environment is being correctly converted to UTF-8 here.
So how about leaving the initial __mbtowc and __wctomb pointers as
they are? They get changed to __ascii_mbtowc and __ascii_wctomb by the
call to setlocale_r (_REENT, LC_CTYPE, "C") in initial_setlocale().
Andy