Skip to content
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

Consider setting Console.OutputEncoding for dotnet test and friends #4605

Closed
bradwilson opened this issue Jul 17, 2023 · 2 comments · Fixed by #4649
Closed

Consider setting Console.OutputEncoding for dotnet test and friends #4605

bradwilson opened this issue Jul 17, 2023 · 2 comments · Fixed by #4649

Comments

@bradwilson
Copy link

bradwilson commented Jul 17, 2023

There was a change in Windows Terminal 1.17 that causes .NET applications that output Unicode characters to the console to have them garbled, because of the default output encoding. This does not happen in prior versions of Windows Terminal, nor in classic "conhost.exe" console windows.

xUnit.net uses characters which are corrupted now when run on Windows Terminal through dotnet test and friends.

Output from xunit.console.exe:

image

Output from dotnet test (in Windows Terminal-hosted Powershell):

image

Output from dotnet test (in conhost-hosted Powershell):

image

While strictly speaking this isn't a bug in VSTest (or xUnit.net), we opted fixed this in xunit/xunit@c4b6ed0 on our side. I would recommend that you consider doing this as well, so that any output from testing frameworks which is outside of ASCII can be presented properly in Windows Terminal.

AB#1865057

@nohwnd
Copy link
Member

nohwnd commented Jul 19, 2023

Thanks for the tip!

@nohwnd
Copy link
Member

nohwnd commented Aug 3, 2023

We will need to check with someone using some exotic system (like chinese) to see if everything looks okay and then implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants