On Wednesday, 20 November 2013 at 00:48:40 UTC, bearophile wrote:
[snip]
Often I have genomic data or other text data that is surely
ASCII (and I can accept a run-time exception at loading time if
it's not ASCII). Once such text is in memory I'd like to not
pay for UTF on it. Sometimes you can do this with
std.string.representation, but there is no opposite function
(http://d.puremagic.com/issues/show_bug.cgi?id=10162 ). Also in
Phobos there are several string/char functions that could be
made faster if the input is assumed to be ASCII. To solve this
problem in languages as Haskell they usually introduce a new
type like AsciiString. In past I have suggested to introduce
such string wrapper in Phobos.
Is that not what phobo's AsciiString is?
http://dlang.org/phobos/std_encoding.html#.AsciiString