[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Patch: Fix printing mutibyte characters as unprintable ch
Re: [Bug-wget] Patch: Fix printing mutibyte characters as unprintable characters on Windows
Sat, 11 Nov 2017 12:06:35 +0200
> From: "YX Hao" <address@hidden>
> Cc: <address@hidden>
> Date: Sun, 5 Nov 2017 23:01:22 +0800
> And I can tell you that 'GetConsoleOutputCP' returns the codepage as command
> 'chcp'. It is right. The gnu 'vsnprintf' doesn't work right with 'setlocale'
I guess this means wget needs to call 'setlocale' with the right
codepage even when NLS is not enabled, because the naïve belief that
the default C locale will show n on-ASCII characters correctly is
false on Windows, especially in multibyte locales. The MSDN
documentation of 'setlocale' confirms that by saying:
The C locale assumes that all char data types are 1 byte and that
their value is always less than 256.