The Case Against Autodecode

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue May 31 11:57:28 PDT 2016


On Friday, May 27, 2016 04:31:49 Vladimir Panteleev via Digitalmars-d wrote:
> On Thursday, 26 May 2016 at 16:00:54 UTC, Andrei Alexandrescu
> >> 9. Autodecode cannot be turned off, i.e. it isn't practical to
> >> avoid
> >> importing std.array one way or another, and then autodecode is
> >> there.
> >
> > Turning off autodecoding is as easy as inserting
> > .representation after any string. (Not to mention using
> > indexing directly.)
>
> This is neither easy nor practical. It makes writing reliable
> string handling code a chore in D. Because it is difficult to
> find all places where this must be done, it is not possible to do
> on a program-wide scale, thus bugs can only be discovered when
> this or that component fails because it was not tested with
> Unicode strings.

In addition, as soon as you have ubyte[], none of the string-related
functions work. That's fixable, but as it stands, operating on ubyte[]
instead of char[] is a royal pain.

- Jonathan M Davis


More information about the Digitalmars-d mailing list