乱码原因:cmd/powershell的编码为GBK,而运行文件编码为UTF-8。
chcp

解决方法(临时有效显示中文):在cmd/powershell中输入
chcp 65001
其他永久解决方法尝试后无效。
补充:
1.尝试了test1.reg(保存后点击运行即可)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console\%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe]
"CodePage"=dword:0000fde9
[HKEY_CURRENT_USER\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe]
"CodePage"=dword:0000fde9
[HKEY_CURRENT_USER\Console\%SystemRoot%_System32_cmd.exe]
"CodePage"=dword:0000fde9
2.尝试了test2.reg(保存后点击运行即可)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe]
"CodePage"=dword:0000fde9
"FontFamily"=dword:00000036
"FontWeight"=dword:00000190
"FaceName"="Consolas"
"ScreenBufferSize"=dword:232900d2
"WindowSize"=dword:002b00d2
3.设置了下图

效果:chcp后显示的为936,但是能正常显示中文了,不知道是哪个生效了。

补充:好像是无效的,我服了。

5336

被折叠的 条评论
为什么被折叠?



