2

I'm using the files that are encoded with UTF-8 but the default encoding for me is EUC-KR(chcp 949), I want to know the way that adapts the UTF-8 as the default encoding of my terminal(automatically when the terminal starts). I'm using PowerShell core 7.0.2. I don't want to type "chcp 65001" anymore when I start it.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
지윤서
  • 21
  • 1
  • 2

1 Answers1

2

In settings.json for Windows Terminal, you can launch Powershell with a command. Make your Powershell profile look something like this:

{
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "name": "Windows PowerShell",
    "commandline": "powershell.exe -NoExit -Command chcp 65001",
    "hidden": false
},

Note about icons: As of the time this was written if you are using a Powershell profile with a guid different than the default{61c54bbd-c2c6-5271-96e7-009a87ff44bf} You will loose the Powershell icon in the launch menu unless you specify another custom icon file or set the icon file back to the system default by setting the icon property in your settings.json Powershell profile like this:

"icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png"

apena
  • 2,091
  • 12
  • 19