Skip to content

Instantly share code, notes, and snippets.

@helephant
Created March 18, 2019 21:26
Show Gist options
  • Save helephant/c949fa8cf85182b61e3f730286b9d538 to your computer and use it in GitHub Desktop.
Save helephant/c949fa8cf85182b61e3f730286b9d538 to your computer and use it in GitHub Desktop.
How to see characters from non-ASCII character sets in powershell

Check to see what output encoding your console has, to make sure the output of your apps don't end up encoded as Ascii.

> $OutputEncoding
IsSingleByte      : True
BodyName          : us-ascii
EncodingName      : US-ASCII
HeaderName        : us-ascii
WebName           : us-ascii
WindowsCodePage   : 1252
IsBrowserDisplay  : False
IsBrowserSave     : False
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 20127

Set it to UTF8

> $OutputEncoding = [Console]::OutputEncoding
> $OutputEncoding
BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : False
CodePage          : 65001

Choose a font that supports your desired character set:

  1. right clicking on the powershell title bar and choose properties
  2. Go to the font tab
  3. SimSun-ExtB supports Japanese characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment