How-to: input/output "Japanese Characters"?

Tyro[a.c.edwards] nospam at home.com
Sat May 2 16:04:13 PDT 2009


On 5/3/2009 7:41 AM, Georg Wrede wrote:
> Tyro[a.c.edwards] wrote:
>> I'm on a Japanese system attempting to input/output Japanese Characters
>> and cannot seem to accomplish it. How would I read
>> "憲法記念日 理念と現実、広がる格差" from stdin/file and output the
>> same to stdout/file?
>
> import std.stdio;
>
> void main()
> {
> auto lin = readln();
> writeln(lin);
> }
>
> Works with your Japanese strings. It just works(tm).

Interesting... for whatever reason I thought I had to cast/convert
to!dstring in order to get the correct output. Which kept resulting in:

  std.utf.UtfException: 4invalid UTF-8 sequence

thank you very much.


More information about the Digitalmars-d-learn mailing list