D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14129 - stdio.write crashed on window console with codepage 65001
Summary: stdio.write crashed on window console with codepage 65001
Status: RESOLVED DUPLICATE of issue 13651
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-06 06:38 UTC by mzfhhhh
Modified: 2021-03-24 20:16 UTC (History)
2 users (show)

See Also:


Attachments
test.json (16.00 KB, text/plain)
2015-02-06 06:38 UTC, mzfhhhh
Details

Note You need to log in before you can comment on or make changes to this issue.
Description mzfhhhh 2015-02-06 06:38:54 UTC
Created attachment 1474 [details]
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 Berni44 2021-03-24 20:16:21 UTC

*** This issue has been marked as a duplicate of issue 13651 ***