Issue 18801 - std.stdio.File doesn't work with MSVCRT's UTF-8 mode
Summary: std.stdio.File doesn't work with MSVCRT's UTF-8 mode
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All Windows
: P1 normal
Assignee: ag0aep6g
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2018-04-26 19:00 UTC by ag0aep6g
Modified: 2020-09-17 09:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ag0aep6g 2018-04-26 19:00:20 UTC
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.
Comment 1 ag0aep6g 2018-04-26 19:18:51 UTC
(In reply to ag0aep6g from comment #0)
> I'm going to try and fix this.

https://github.com/dlang/phobos/pull/6477
Comment 2 Dlang Bot 2019-05-09 15:42:09 UTC
@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 Dlang Bot 2020-09-17 09:42:39 UTC
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