-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Problem with printing UTF8 with NO BOM #5825
Comments
You could try setting your code page to UTF-8 with |
Thanks. interesting that it works in Command but not PowerShell. Is there a way to set it as the default in the settings. At least for the Command shell? Separately I'll submit feedback that CHCP would allow names, not numbers. It should be easy to update it to circa 1999. |
Checking there seem to be ways to set it in the register but given Windows Terminal has a settings file that would seem the appropriate place. |
I think I have the same error. hmm :/ |
So, at its core, this is a request for /dup #1802. I'm not averse to breaking compatibility here, we just haven't done the work necessary here 😄 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
(Thanks for the report!) |
As for why this curiously worked in CMD but not Powershell (and you're actually talking about Powershell here and not Powershell Core), I think it's because Powershell has a requirement of a BOM and your text was without one. There's a solution though -- one may additionally need to first set:
Note that this is no longer necessary in Powershell Core, which thankfully no longer expects a BOM for UTF-8. |
in PowerShell 7 it is printed correctly, on windows PowerShell you need to pass |
Environment
Steps to reproduce
create a file with utf-8 content as in
type test.txt
Expected behavior
It should simply show
Actual behavior
In PowerShell and with BOM see the proper output
Very simply Windows still seems stuck in the old days of UTF7 After 25 years of Unicode, it needs to grow up. At very least there should be a flag in the settings to enable UTF8 as a default.
The text was updated successfully, but these errors were encountered: