test.d: ---- import std.file: readText; import std.stdio: File; import std.string: stripLeft; void main() { { auto f = File("test.txt", "w,ccs=UTF-8"); f.write("foo"); } 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.
(In reply to ag0aep6g from comment #0) > I'm going to try and fix this. https://github.com/dlang/phobos/pull/6477
@aG0aep6G updated dlang/phobos pull request #6477 "[WIP] fix issue 18801 - std.stdio.File doesn't work with MSVCRT's UTF-8 mode" fixing this issue: - fix issue 18801 - std.stdio.File doesn't work with MSVCRT's UTF-8 mode https://github.com/dlang/phobos/pull/6477
dlang/phobos pull request #6477 "fix issue 18801 - std.stdio.File doesn't work with MSVCRT's UTF-8 mode" was merged into master: - 6854f0c84a40e9d7b9e98b668502f6c4db50a84b by aG0aep6G: fix issue 18801 - std.stdio.File doesn't work with MSVCRT's UTF-8 mode https://github.com/dlang/phobos/pull/6477