[Issue 18844] std.utf.decode skips valid character on invalid multibyte sequence

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 9 10:54:41 UTC 2018


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

--- Comment #1 from FeepingCreature <default_357-line at yahoo.de> ---
Repro:

    string s = cast(string) [cast(ubyte) 'ä', 't'];
    size_t i = 0;
    auto ch = decode!(UseReplacementDchar.yes, string)(s, i);
    writefln("ch = %s, i = %s, should be 1", ch, i);

ch = �, i = 2, should be 1.

--


More information about the Digitalmars-d-bugs mailing list