Wired question related with Chinese characters

walker growup_wei at qq.com
Sun Mar 22 15:19:13 UTC 2020


I am new to dlang, I like it :)
I am on windows10 and use the terminal preview to test and run 
programs.

In order to print Chinese characters correctly, I always use

void main()
{
string var1 = "你好"; # to!string(in_other_conditions)
writeln(var1);
}

I tried dstring but not working. Need Help Here.

---------------------------------
The wired thing is the above approach may not work sometimes -> 
corrupted characters show up.

However, if I run in the same place a little program written in 
nim (just print hello world), then I run the same dlang program, 
the Chinese character is print correctly.

Why that happened?


More information about the Digitalmars-d-learn mailing list