Re: Writing unicode strings to the console

2012-12-18 Thread Sam Hu
On Tuesday, 18 December 2012 at 00:29:56 UTC, 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

Re: Writing unicode strings to the console

2012-12-18 Thread monarch_dodra
On Tuesday, 18 December 2012 at 00:29:56 UTC, 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

Writing unicode strings to the console

2012-12-17 Thread Jeremy DeHaan
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

Re: Writing unicode strings to the console

2012-12-17 Thread bearophile
Jeremy DeHaan: Is it possible to write the unicode string to the console correctly? What is your operating system? On oldish Windows you have to set the console to Unicode or nearly Unicode. I don't know about Windows7/8. Bye, bearophile

Re: Writing unicode strings to the console

2012-12-17 Thread Adam D. Ruppe
I suggest you use string instead of dstring, because utf-8 (string) has better output support than utf-32 (dstring), and both support the complete unicode character set. If string doesn't work, the question is: Windows or Linux? On Windows, the api call SetConsoleOutputCP will help

Re: Writing unicode strings to the console

2012-12-17 Thread H. S. Teoh
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

Re: Writing unicode strings to the console

2012-12-17 Thread Jeremy DeHaan
@Adam D. Ruppe I suggest you use string instead of dstring, because utf-8 (string) has better output support than utf-32 (dstring), and both support the complete unicode character set. Tried string and wstring. Both had the same results as my dstring. On Windows, the api call

Re: Writing unicode strings to the console

2012-12-17 Thread Adam D. Ruppe
On Tuesday, 18 December 2012 at 00:59:12 UTC, Jeremy DeHaan wrote: How/Where would I call this? Right at the beginning of your main, but after trying it, I don't think this is going to fix your problem anyway... I think it is fonts. But: import std.stdio; extern(Windows) int