[Issue 11712] New: Unicode bug in std.string.inPattern
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 9 08:09:22 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11712
Summary: Unicode bug in std.string.inPattern
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: qznc at web.de
--- Comment #0 from qznc at web.de 2013-12-09 08:09:19 PST ---
The following assert fails, but should not.
assert(!inPattern('a', "äöüa-z"));
The problem is the combination of "foreach (size_t i, dchar p; pattern)" with
"i + 1 < pattern.length". Due to foreach "i" is the index of the code point,
but the comparison assumes an index of code unit. The pattern string consists
of 6 code points, but 9 code units.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list