Thread overview | |||||
---|---|---|---|---|---|
|
December 01, 2010 utf ranges | ||||
---|---|---|---|---|
| ||||
Is there a way in phobos to reencode a dchar range as a utf8 bytestream? |
December 01, 2010 Re: utf ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | 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 Re: utf ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | >
> 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
|
Copyright © 1999-2021 by the D Language Foundation