On 23 November 2012 17:59, Erwin Waterlander <waterlan@xs4all.nl> wrote:
Op 23-11-2012 10:45, Yongwei Wu schreef:
> On 23 November 2012 16:34, Erwin Waterlander <waterlan@xs4all.nl
> <mailto:waterlan@xs4all.nl>> wrote:
>
>     * There is no way an Unicode console program can output Chinese text
>     (Using WriteConsoleW()) in the Windows Console when the active
>     code page
>     is not cp936 (because the font is not available). This is actually
>     weird, because the console code page is for non-Unicode programs.
>
>
> I can successfully output "测试" with the following line of code, when
> the console code page is 437 or 1252:
>
> WriteConsoleW(hConsole, L"\u6d4b\u8bd5\n", 3, &dwLen, NULL);
>
> However, I know my system locale is Simplified Chinese. Can you have a
> try whether it works for you?
>

Hi Yongwei,

That's correct. When the system locale is Simplified Chinese, and the
active code page is 1252 (Western European), I can also output Chinese
characters in the console while the font is Lucida Console.
But when I change the system locale to English (United States) it
doesn't work any more. Then I get two squares for the Chinese letters.

So Unicode in the console seems to work better with a Chinese system locale.

OK, Microsoft has a broken design. Maybe you should forget the consoles :-).

--
Wu Yongwei
URL: http://wyw.dcweb.cn/