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.
https://bugs.winehq.org/show_bug.cgi?id=54753
--- Comment #1 from Robert T rjtulloh@gmail.com --- Created attachment 74248 --> https://bugs.winehq.org/attachment.cgi?id=74248 Program output in Windows cmd.
https://bugs.winehq.org/show_bug.cgi?id=54753
--- Comment #2 from Robert T rjtulloh@gmail.com --- Created attachment 74249 --> https://bugs.winehq.org/attachment.cgi?id=74249 Program output in Wine.
https://bugs.winehq.org/show_bug.cgi?id=54753
Neko-san nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nekoNexus@protonmail.ch
https://bugs.winehq.org/show_bug.cgi?id=54753
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #3 from Eric Pouech eric.pouech@gmail.com --- and what does print?
wine wineconsole test-mingw.exe
https://bugs.winehq.org/show_bug.cgi?id=54753
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #4 from Fabian Maurer dark.shadow4@web.de --- (In reply to Eric Pouech from comment #3)
and what does print?
wine wineconsole test-mingw.exe
That opens a window that immediately closes again. If I run wine wineconsole and then the exe, it only outputs garbage. The last line seems to be replacement characters, even with "winetricks corefonts fakejapanese".
FWIW, I can't get it to work on Win7 x64 at all.
https://bugs.winehq.org/show_bug.cgi?id=54753
--- Comment #5 from Eric Pouech eric.pouech@gmail.com ---
(In reply to Robert T from comment #0)
can you also share the compilation options for mingw & msvc?