https://bugs.winehq.org/show_bug.cgi?id=54753
Bug ID: 54753 Summary: stdout/cout do not respect console code page in apps compiled with mingw-w64 Product: Wine Version: 8.4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: rjtulloh@gmail.com Distribution: ---
Created attachment 74247 --> https://bugs.winehq.org/attachment.cgi?id=74247 Test program which outputs to the console in different ways.
I noticed some cases recently where Wine seemed to ignore the console code page when apps were writing to stdout. Upon further investigation, I found it seems to be specific to apps compiled via mingw64.
I've attached a simple test program which demonstrated the issue. It switching the code page to UTF8 and then outputs some Japanese glyphs in different ways.
On Windows, this program behaves as expected - the same string is printed for times.The output does not differ based on the compiler used.
In Wine, if the program is compiled with mingw-w64, it will output gibberish 3 times, and the correct string is only produced by calling the WriteConsoleA function.
This seems to be specific to the way mingw implements stdout, as if the application is compiled with clang in MSVC compatibility mode, there is no issue with the output. It does not seem to be a mingw bug, since the output is correct on Windows.