[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 30 15:13:10 PDT 2015


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

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu

--- Comment #23 from Martin Nowak <code at dawg.eu> ---
(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.

No one is suggesting you operate on ubyte[] as string.
What people are is saying is you should validate a ubyte[] array before
converting it to a string. This is by the way how readText works. You'll have
to cast raw data to string to get strings with invalid UTF.

--


More information about the Digitalmars-d-bugs mailing list