Bug 18789 – std.stdio messes up UTF conversions on output

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-04-21T15:28:37Z
Last change time
2020-10-06T18:09:37Z
Keywords
pull
Assigned to
ag0aep6g
Creator
ag0aep6g

Comments

Comment #0 by ag0aep6g — 2018-04-21T15:28:37Z
---- import std.stdio; void main() { // converting to char { auto f = File("test.txt", "w"); f.writeln("\U0001F608"w); // UTFException } // converting to wchar_t { auto f = File("test.txt", "w,ccs=UTF16LE"); // from char f.writeln("รถ"); // writes garbage f.writeln("\U0001F608"); // ditto // from wchar f.writeln("\U0001F608"w); // leads to ErrnoException } } ---- PR follows.
Comment #1 by ag0aep6g — 2018-04-21T15:32:16Z
(In reply to ag0aep6g from comment #0) > PR follows. https://github.com/dlang/phobos/pull/6469
Comment #2 by github-bugzilla — 2018-04-29T17:56:00Z
Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d5cc4c5087a1819ac716cb5ea11d988fa667f822 fix conversion from wchar to char in LockingTextWriter.put Fixes the easier part of issue 18789.
Comment #3 by dlang-bot — 2020-09-17T22:23:00Z
@aG0aep6G updated dlang/phobos pull request #6469 "[WIP] fix issue 18789 - std.stdio messes up UTF conversions on output" mentioning this issue: - fix conversion from wchar to wchar_t in LockingTextWriter.put This fixes issue 18789. https://github.com/dlang/phobos/pull/6469
Comment #4 by dlang-bot — 2020-10-06T17:17:32Z
dlang/phobos pull request #6469 "fix issue 18789 - std.stdio messes up UTF conversions on output" was merged into master: - 41f78fc1e111323a5097a2f96d8e232cb27e01d1 by aG0aep6G: fix conversion from wchar to wchar_t in LockingTextWriter.put This fixes issue 18789. - e7e75cf2343bee5bae24622ef8035cde159b6c52 by aG0aep6G: add the original test case of issue 18789 ... to ensure that it doesn't throw any exceptions like it used to. https://github.com/dlang/phobos/pull/6469
Comment #5 by ag0aep6g — 2020-10-06T18:09:37Z
(In reply to Dlang Bot from comment #4) > This fixes issue 18789. Not sure why the bot didn't pick that up. Closing as fixed.