-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Encoding in Console Output with WinExe OutputType #111057
Comments
Tagging subscribers to this area: @dotnet/area-system-console |
Why are you asking for console when you explicitly disabled console by using |
Not having a visible output window is not the same as not having output altogether.
There are then many ways for an The general issue here looks to be that The general console environment on Windows has changed a lot over recent years, while I expect its something that could be fixed, but which is not a trivial task and which has a high chance of impacting existing Windows console applications. -- Some of these nuances also show up on Linux, since the Linux environment for console/terminal handling is a bit different and doesn't "cleanly" map onto what .NET had exposed (which was largely oriented around the Windows APIs from 25 years ago). |
Description
When setting the
OutputType
toWinExe
, the console output is encoded incorrectly, resulting in garbled text.Reproduction Steps
OutputType
toWinExe
.You will notice that the encoding of
StandardOutput
in the console is set toCodePage=0
, which causes other software attempting to capture the application's output to display garbled text for some Unicode content.I have written a simple demo program to illustrate this issue. Here is my code:
You can access the entire project code from https://github.com/lindexi/lindexi_gd/tree/0dc56dbf6f635a7cc9cbda295b1cbe40c2eab8d9/Workbench/YemwearqufeballnoBayboqemli
Expected behavior
When setting
OutputType
toWinExe
, it should still be possible to obtain the correct output encoding.Actual behavior
Currently, it results in garbled text. This directly affects debugging WinExe applications in Rider, and it is not possible to set
Console.OutputEncoding
to UTF-8.Reference: dotnet-campus/dotnetCampus.Logger#32
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: