Bug 18801 – std.stdio.File doesn't work with MSVCRT's UTF-8 mode
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2018-04-26T19:00:20Z
Last change time
2020-09-17T09:42:39Z
Keywords
pull
Assigned to
ag0aep6g
Creator
ag0aep6g
Comments
Comment #0 by ag0aep6g — 2018-04-26T19:00:20Z
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.
@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
Comment #3 by dlang-bot — 2020-09-17T09:42:39Z
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