Bug 14129 – stdio.write crashed on window console with codepage 65001

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2015-02-06T06:38:54Z
Last change time
2021-03-24T20:16:21Z
Assigned to
No Owner
Creator
mzfhhhh

Attachments

IDFilenameSummaryContent-TypeSize
1474test.jsontest.jsontext/plain16385

Comments

Comment #0 by mzfhhhh — 2015-02-06T06:38:54Z
Created attachment 1474 test.json windows console default codepage is 936, it's show chinese char is uncorrect. so i input the command "chcp 65001" change the codepage . then in most cases,it's works ok! but write a special file,it's crashed. -------------------- import std.stdio; import std.file; int main(string[] argv) { auto s = readText(r".\test.json"); write(s); //crashed return 0; } std.exception.ErrnoException@C:\D\dmd2\windows\bin\..\..\src\phobos\std\stdio.d(2113): (No error) ---------------- 0x00402998 0x00402901 0x00402897 0x00402881 0x004027AA 0x004040B3 0x00403FC9 0x00402AF3 0x776C1194 in BaseThreadInitThunk 0x779AB3F5 in RtlInitializeExceptionChain 0x779AB3C8 in RtlInitializeExceptionChain Failed to flush stdout: No error
Comment #1 by bugzilla — 2021-03-24T20:16:21Z
*** This issue has been marked as a duplicate of issue 13651 ***