[Issue 20134] autodecode should use replacementDchar rather than throwing on invalid
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 16 00:20:47 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20134
Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dlang-bugzilla at thecybershad
| |ow.net
--- Comment #3 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
(In reply to Walter Bright from comment #1)
> Over time, common practice has evolved from rejecting malformed UTF to
> replacing it with replacementDchar, which enables the application (like a
> web browser) to continue processing.
In applications where not crashing is preferrable to corrupting data, yes, but
I don't think we can make that decision in place of the user. Corrupted data
spreads and seeps into archives and can be very hard to rectify once it's
discovered, but crashes are immediately visible and usually easily fixable.
> Code should also be faster with this change.
So should either assuming that the strings are valid, or throwing Errors
instead of Exceptions, right?
--
More information about the Digitalmars-d-bugs
mailing list