https://issues.dlang.org/show_bug.cgi?id=14519

--- Comment #22 from Marc Schütz <schue...@gmx.net> ---
(In reply to Vladimir Panteleev from comment #20)
> (In reply to Marc Schütz from comment #18)
> > Data with other (or unknown) encodings needs to be stored in `ubyte[]`.
> 
> Have you tried using ubyte[] to process ASCII text? It's horrible, you have
> to cast at every step, and nothing in std.string works even when it should.

For ASCII text, char[] is okay, UTF8 is a superset of ASCII.

But you're right for other encodings. That's why those need to be converted "at
the border": To UTF8 when read from a file or stdin, main() args, env vars, and
from UTF8 to whatever on writing. Internally, they need to be UTFx encoded.
This is the only sane way to handle different text encodings, IMO.

--

Reply via email to