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
out-file -append (or ">>") can mix two encodings in the same file #9423
Comments
To summarize the inconsistency:
While Generally, unlike in the Windows world, Unix shells and utilities assume that one encoding is in use everywhere, as reflected in the As for the Windows PowerShell situation:
The behavior is technically not undocumented, but misdocumented: please see MicrosoftDocs/PowerShell-Docs#4155 |
I assume "Out-Content" should be "Out-File" at that link (different noun). |
Thanks, @jszabo98 - fixed; I've also added info about a few more cmdlets. |
Out-File could detect a file encoding at open time like Add-Content. |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
2 similar comments
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. |
Out-file -append (or ">>") can mix two encodings, like unicode and utf8, in the same file. Add-content doesn't seem to suffer from this. Note that out-file in PS 5.1 uniquely defaults to unicode
(undocumented). But the problem itself is in both out-file for PS 5.1 & PS 6.
Steps to reproduce
(or write-output hi >> hi.txt for line 2)
Expected behavior
Actual behavior
line one is unicode, line 2 is utf8
Environment data
The text was updated successfully, but these errors were encountered: