dmd foreach loops throw exceptions on invalid UTF sequences, use replacementDchar instead

Elronnd elronnd at elronnd.net
Thu Nov 4 07:55:59 UTC 2021


Part of the problem, as mentioned, is that this throws away 
information, because text may legitimately contain replacement 
characters.  (And this makes the 'check if replacement char and 
throw yourself' approach a non-starter).  But there are lossless 
encodings.  I think if we are really going to go this route, we 
should use something like raku's utf8-c8 
(https://docs.raku.org/language/unicode#UTF8-C8).


More information about the Digitalmars-d mailing list