The Case Against Autodecode
Nick Treleaven via Digitalmars-d
digitalmars-d at puremagic.com
Fri May 13 05:16:30 PDT 2016
On Friday, 13 May 2016 at 00:47:04 UTC, Jack Stouffer wrote:
> If you're serious about removing auto-decoding, which I think
> you and others have shown has merits, you have to the THE
> SIMPLEST migration path ever, or you will kill D. I'm talking a
> simple press of a button.
char[] is always going to be unsafe for UTF-8. I don't think we
can remove it or auto-decoding, only discourage use of it. We
need a String struct IMO, without length or indexing. Its front
can do autodecoding, and it has a ubyte[] raw() property too.
(Possibly the byte length of front can be cached for use in
popFront, assuming it was faster). This would be a gradual
transition.
More information about the Digitalmars-d
mailing list