How to print Chinese characters in console in window XP?

Jarrett Billingsley jarrett.billingsley at gmail.com
Sat Jun 27 06:08:24 PDT 2009


On Sat, Jun 27, 2009 at 5:53 AM, Sam Hu<samhudotsamhu at gmail.com> wrote:
> In DMD2030 I just found that Chinese characters the like can not print properly into console.
>
> //Below code does not show output properly in windows console:
> void main()
> {
> wstring country="中国";
> writefln(country);
> }
>
>
>
> Is this an OS issue or is there any way to reach the goal?

It's an OS issue.  Someone asks about this once every two weeks.  You
have to set up cmd.exe to use Unicode.  You have to change the fonts
to Lucida, I think, and use 'chcp 65001' before running your program.


More information about the Digitalmars-d-learn mailing list