[Issue 23588] New: Std lacks a way to read Unicode from a file expect by line

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 28 17:35:58 UTC 2022


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

          Issue ID: 23588
           Summary: Std lacks a way to read Unicode from a file expect by
                    line
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: crazymonkyyy at gmail.com

```
struct filebydchar{
        dstring me; alias me this;
        this(string s){
                import std.file;
                import std.conv;
                me=readText(s).to!dstring;
        }
        int i;
        dchar front(){
                return me[i];
        }
        void popFront(){
                i++;
        }
        bool empty(){
                return i>=me.length;
        }
}
```

I would expect a `std.File.byDChar` rather then what may be poor attempts at
implementing unicode logic on some c interface

--


More information about the Digitalmars-d-bugs mailing list