Thread overview
utf ranges
Dec 01, 2010
Ellery Newcomer
Dec 01, 2010
Jonathan M Davis
Dec 01, 2010
Ellery Newcomer
December 01, 2010
Is there a way in phobos to reencode a dchar range as a utf8 bytestream?
December 01, 2010
On Tuesday 30 November 2010 16:06:39 Ellery Newcomer wrote:
> Is there a way in phobos to reencode a dchar range as a utf8 bytestream?

You could do to!string() to turn it into a UTF-8 array. What precisely are looking for with regards to bytestream? You could then write that to a stream from std.stream (though std.stream is going to be deprecated), though there is no way as far as I know to write a dchar range as UTF-8 code units to a stream (if nothing else, because the current std.stream isn't range-based), though I suppose that you could convert it a string in smaller chunks (to avoid the extra memory allocation) and then write to the stream in chunks.

I'm afraid that I'm not clear enough on exactly what you're looking to do to give you a proper suggestion.

- Jonathan M Davis
December 01, 2010
>
> I'm afraid that I'm not clear enough on exactly what you're looking to do to
> give you a proper suggestion.
>

on further reflection, neither am I.

I suppose to!string is what I want