wstring hex literals

jmh530 john.michael.hall at gmail.com
Wed Sep 20 15:04:08 UTC 2017


I don't seem to be having any issues making strings or dstrings 
from hex, but I run into some issues with wstrings. Of course, my 
knowledge of UTF-16 is limited, but I don't see any issues with 
the code below and I get some errors on the hex string literal.

unittest
{
     wchar data = 0x03C0;
     auto data2 = x"03C0"w;
     static assert(typeof(data2) == wstring);
}

testing_utf16.d(5): Error: Truncated UTF-8 sequence
testing_utf16.d(6):        while evaluating: static 
assert((_error_) == (wstring
))
Failed: ["dmd", "-unittest", "-v", "-o-", "testing_utf16.d", 
"-I."]


More information about the Digitalmars-d-learn mailing list