如下代码存为 *.reg
文件:shell
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe] "CodePage"=dword:0000fde9
双击运行此文件。编辑器
注:字体
65001(UTF-8)
的十六进制表示为:0000fde9
编码
963(GBK)
的十六进制表示为:000003a8
code
每次启动后输入:chcp 65001
文档
在控制台输入:it
notepad $PROFILE
启动记事本打开配置文件,通常为:io
<库>\<文档>\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
也在找到此文件,用其余编辑器打开,在其中添加:配置
chcp 65001
注:后两种方法会形成在 65001
编码下设置好的控制台字体失效。file
Conemu
/Cmder
在此 Settings>Startup>Environment
选项下,添加 chcp 65001
注:yarn
的进度条在其中有问题