6

I have some problems with displaying Chinese characters in the Powershell console. All Chinese are shown as rectangles there. I believe this is an encoding problem. Does anyone know how to configure the Powershell console to use UTF8 encoding?

halfer
  • 19,824
  • 17
  • 99
  • 186
hackjutsu
  • 8,336
  • 13
  • 47
  • 87

1 Answers1

14

Have a look at this post

Current Encoding: [Console]::Out

Set Encoding (UTF8): [Console]::OutputEncoding = [System.Text.Encoding]::UTF8

Community
  • 1
  • 1
Martin
  • 1,853
  • 3
  • 15
  • 22
  • It seems we have to configure it for every PowerShell instance. Can we set the UTF8 encoding as default? – hackjutsu Feb 23 '16 at 19:38
  • 1
    You can put it in the PS profile, which is loaded upon instance start. – Martin Feb 23 '16 at 22:55
  • 3
    That makes language specific characters just disappear from the output i.e. instead of ' ŻÓŁTY ' there is just ' TY '. Is there a way to fix this? – Sharak Jan 26 '19 at 17:12