Code page isn't being set correctly when piping commands #1371
Labels
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Needs-Author-Feedback
Issue needs attention from issue or PR author
No-Recent-Activity
Issue has no recent activity
Milestone
Brief description of your issue
By default the code page on Windows for en-US devices is
437 (OEM - United States)
but when runningwinget search tencent | sort
it automatically switches the code page to65001 (UTF-8)
and then switches the code page back to437 (OEM - United States)
^ This isn't an issue here because the same happens to
winget search
andwinget list
but when piping thewinget search
command to| sort
or| find
it displays corrupted characters until the code page is permanently set to65001 (UTF-8)
.Perhaps it's switching the code page back to
437 (OEM - United States)
halfway through?I am using Windows Terminal Preview here because Command Prompt doesn't support all of the special characters shown in
winget search
.Steps to reproduce
winget source update
winget search | sort
Expected behavior
chcp 65001
- permanently set code page to UTF-8winget source update
winget search tencent | sort
Notice how there's no corrupted characters shown.
Actual behavior
winget source update
winget search tencent | sort
Notice how there's corrupted characters shown.
Environment
Any other software?
This issue is a duplicate of the now closed #1331 and was mentioned in #1300.
The text was updated successfully, but these errors were encountered: