[Issue 18105] std.conv.parse!wchar cannot take a string

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 20 10:57:14 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18105

--- Comment #5 from dechcaudron+dlang.issue.tracking at protonmail.com ---
I am now aware of the complexity of UTF-16 encoding, with surrogate pairs and
all (just read the standard). While I agree the solution is not trivial, if we
do allow parse!char(string), we should allow parse!wchar(string) in the same
fashion. When using 'char', there is no guarantee that the returned value will
be a valid UTF-8 code point. It just gets the next 'char' code unit from the
string, and so should 'wchar' IMHO. That is, taking the next 2 'char' from the
string.

--


More information about the Digitalmars-d-bugs mailing list