www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18801] New: std.stdio.File doesn't work with MSVCRT's UTF-8


          Issue ID: 18801
           Summary: std.stdio.File doesn't work with MSVCRT's UTF-8 mode
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

import std.file: readText;
import std.stdio: File;
import std.string: stripLeft;

void main()
        auto f = File("test.txt", "w,ccs=UTF-8");
    assert(readText!string("test.txt").stripLeft("\uFEFF") == "foo");

Crashes on Windows when compiled with -m32mscoff or -m64. std.stdio tries using
fputc which doesn't work in Microsoft's Unicode mode.

I'm going to try and fix this.

Apr 26 2018