[Issue 17861] UTF Decode fails with exception

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 3 21:37:43 UTC 2017


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

--- Comment #9 from Etienne <etcimon at gmail.com> ---
The std.utf.decode debate is a rough one and seems to have its workarounds. 

On the other hand, you have this forgotten code at rt.util.utf where everything
is so low-level and there is no option to use a replacement character. This is
something that comes up on a foreach loop on a string. I don't know why anyone
would expect foreach to throw? It's a little strange. 

Obviously the whole library should default to a replacement character, but
rt.util.utf is a little more urgent because of how much of a surprise it is for
a foreach loop to be throwing, whereas you don't really expect it to behave
like a function and it can happen in edge cases on release builds where things
become very difficult to debug.

--


More information about the Digitalmars-d-bugs mailing list