Skip to content

Instantly share code, notes, and snippets.

@youngyou
Forked from xoner/UTF8DefEncoding.ps1
Created June 16, 2016 07:11
Show Gist options
  • Save youngyou/4b7ace011fd82375d20e07ca8e607a45 to your computer and use it in GitHub Desktop.
Save youngyou/4b7ace011fd82375d20e07ca8e607a45 to your computer and use it in GitHub Desktop.
Set the default en coding to UTF-8 in powershell. As seen in http://blogs.msdn.com/b/powershell/archive/2006/12/11/outputencoding-to-the-rescue.aspx
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment