Reading unicode chars..

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 3 01:21:29 PDT 2014


On Tuesday, 2 September 2014 at 23:20:38 UTC, Ali Çehreli wrote:
> On 09/02/2014 02:13 PM, monarch_dodra wrote:
>
> > I'd suggest you create a range out of your std.stream.File,
> which reads
> > it byte by byte.
>
> I was in the process of doing just that.
>
> > Then, you pass it to the "byDchar()" range, which will
> > auto decode those characters. If you really want to do it
> "character by
> > character".
>
> I first started writing my own byDchar but then used 
> std.utf.byDchar as you suggest. However, I had to resort to
>
> 1) Adding attributes to function calls which I know some are 
> unsafe (see assumeHasAttribs() below). For example, I don't 
> think getc() should be pure. (?) Also, how could all of its 
> functions be nothrow? Is byDchar() is asking too much of its 
> users?

https://github.com/D-Programming-Language/phobos/pull/2483


More information about the Digitalmars-d-learn mailing list