-
Notifications
You must be signed in to change notification settings - Fork 8.2k
out-file -append (or ">>") can mix two encodings in the same file #9423
Copy link
Copy link
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
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