How to print unicode like: こ ん に ち は 世 界

Jesse Phillips jessekphillips+D at gmail.com
Thu May 19 09:51:04 PDT 2011


Matthew Ong Wrote:

> Hi,
> 
> import std.stdio;
> alias immutable(wchar)[] String;
> String str="Hello, world; or Καλημέρα κόσμε; or こんにちは 世界";
> writeln(str); // It prints garbage on console.
> 
> In Java and Go, that just works. I believe UTF-X is handles that.
> 
> How to do that within D?
> 
> Yes. I am still new to D. No. I am not japanese but chinese.
> 
> 
> Matthew Ong

consoles tend not to display Unicode, generally you need to tell it to use a font that supports it and I've heard people say you can pass a string to the console to say the output is unicode.

This has been the only issue I've seen people have, D operates just fine with Unicode.



More information about the Digitalmars-d-learn mailing list