[Issue 18844] std.utf.decode skips valid character on invalid multibyte sequence
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 26 09:40:22 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=18844
Ate Eskola <Ajieskola at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Ajieskola at gmail.com
--- Comment #2 from Ate Eskola <Ajieskola at gmail.com> ---
Additional observation: the documentation is misleading with both the present
and proposed behaviour. It says "If the code point is not well-formed, then a
UTFException is thrown and index remains unchanged.".
Well, we don't throw here since we're using replacement characters, so maybe
it's a hint that the part about index remaining unchanged does not apply
either. On the other hand, the documentation doesn't say what happens to the
index instead. At least for me, it gave the wrong impression that index
wouldn't be advanced.
--
More information about the Digitalmars-d-bugs
mailing list