dmd foreach loops throw exceptions on invalid UTF sequences, use replacementDchar instead
Walter Bright
newshound2 at digitalmars.com
Fri Nov 5 00:42:29 UTC 2021
On 11/4/2021 12:55 AM, Elronnd wrote:
> 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).
There's only one replacement character, and this use is officially what it is
for. If you're using it for other porpoises, you've got a whale of a problem.
More information about the Digitalmars-d
mailing list