December 09, 2013 [Issue 11712] New: Unicode bug in std.string.inPattern | ||||
---|---|---|---|---|
| ||||
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@puremagic.com ReportedBy: qznc@web.de --- Comment #0 from qznc@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: ------- |
December 10, 2013 [Issue 11712] Unicode bug in std.string.inPattern | ||||
---|---|---|---|---|
| ||||
Posted in reply to qznc@web.de | https://d.puremagic.com/issues/show_bug.cgi?id=11712 qznc@web.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #1 from qznc@web.de 2013-12-09 22:35:46 PST --- Sorry, confusion on my part. The assertion is wrong, inPattern is correct. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation