Perhaps should have written "and/or" in the subject line since the two are not mutually exclusive.

I was showing off D to friends the other day:

import std.stdio;
void main()
{
  foreach (d; "你好")
    writeln(d);
}


IIRC, this used to work fine, with the variable "d" getting deduced as "dchar" and correctly reassembling the UTF-8 bytes into Unicode codepoints.

But when I run this code in OSX, dmd v2.064, I get this:

$ dmd -run uni.d
�
�
�
�
�
�

It's clearly printing the bytes. When I print the typeof(d) I get "immutable(char)", so that confirms the type is not deduced as "dchar".

I could have sworn this used to work. Is my memory failing me, or was this a deliberate change at some point? Perhaps a regression?

L.

Reply via email to