Created
October 31, 2022 05:43
-
-
Save Roman-Port/be1c4097dfcce623bf9a52707a72d812 to your computer and use it in GitHub Desktop.
Repairing Windows Powershell Text Mangling When Piping to File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi! Quick tip I found out for anyone (or myself) who accidentally piped or concatenated important data to a file with Powershell and found that text was mangled. You might see "’" converted to "ΓÇÖ" or "Mötley Crüe" converted to "M├╢tley Cr├╝e" for example. | |
To fix, simply run this command in Powershell after editing the input and output filenames: | |
``` | |
Get-Content [input] | Out-File [output] -Encoding Oem | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment