Skip to content

Instantly share code, notes, and snippets.

@Roman-Port
Created October 31, 2022 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Roman-Port/be1c4097dfcce623bf9a52707a72d812 to your computer and use it in GitHub Desktop.
Save Roman-Port/be1c4097dfcce623bf9a52707a72d812 to your computer and use it in GitHub Desktop.
Repairing Windows Powershell Text Mangling When Piping to File
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