https://zhuanlan.zhihu.com/p/521376336
以 将编码更改为 UTF-8 为例
CMDchcp 查看当前的代码页chcp 65001 切换成 UTF-8需要管理员权限
仅用于 CMD 不适用于 powershell(powershell 修改编码的方法参考扩展)
win+R 运行 regedit\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor 目录autorunchcp 65001 > nul> nul 可以避免每次使用都输出 Active code page: 65001参考:
!!! 执行前,请务必备份注册表
需要管理员权限
.reg 注册表文件导入| 代码页 | 国家/地区或语言 |
|---|---|
| 437 | United States |
| 936 | 中文 |
| 65000 | UTF-7 * |
| 65001 | UTF-8 * |
参考:
【参考】Windows 修改控制台编码为 UTF-8 - 跑起来有风: https://mxy.cool/2021052715441/
【扩展】chcp | Microsoft Docs: https://docs.microsoft.com/zh-cn/windows-server/administration/windows-commands/chcp
【扩展(修改 powershell 以及全局修改)】Using UTF-8 Encoding (CHCP 65001) in Command Prompt / Windows Powershell (Windows 10) - Stack Overflow: https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window