[Issue 15882] writeln on a bad dstring triggering assert(0) in std.utf.toUTF8
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Apr 6 10:08:26 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=15882
--- Comment #2 from erikas.aubade at gmail.com ---
An assert failure is not considered a recoverable error; as i understand it
should be indicative of a critical flaw in logic, not an indication of bad
input.
It's also inconsistent with the way D treats bad unicode elsewhere. For
instance, if you put that bad string in a struct, it will wrilen with no error
and simply display as a hex-literal. In the functions that decode utf8 to
utf32, bad unicode will issue a recoverable exception.
--
More information about the Digitalmars-d-bugs
mailing list