"C" character set (again)

Andy Koppe andy.koppe@gmail.com
Sun Jan 10 15:28:00 GMT 2010


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



More information about the Cygwin-developers mailing list