Writing unicode strings to the console

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Dec 17 16:45:32 PST 2012

On Tue, Dec 18, 2012 at 01:29:55AM +0100, Jeremy DeHaan wrote:
> I was playing with unicode strings the other day, and have been
> searching for a way to correctly write unicode to the console.
> If I try something like:
> dstring String = "さいごの果実";
> writeln(String);
> All I get is a bunch of nonsense as if it converts the dstring into a
> regular string. Is it possible to write the unicode string to the
> console correctly?

It works for me (urxvt on Linux/64bit).

What console are you using? Does your console support Unicode output?
Did you set the console's encoding to UTF-8?


One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie. -- The Silicon Valley Tarot

More information about the Digitalmars-d-learn mailing list