One: Phenomenon

Sometimes we find garbled characters when executing commands on the cmd command line, as shown in the figure
image.png

Two: Solution:

1: Temporarily solve the problem of garbled command line

Execute CHCP on the command line to view the current command line active code page number
image.png

Some common code page numbers have the following meanings:

 65001   UTF-8代码页
950繁体中文
936简体中文默认的GBK
437 MS-DOS美国英语

execute at the command line

 CHCP 65001

At this time, we found that the problem of garbled command line was solved.
image.png

2: Permanently solve the problem of garbled command line

Create a new txt file and add the following content to the txt file

 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

Then modify the txt file suffix to a reg suffix file, and then execute it to solve the problem of Chinese garbled characters


huaweichenai
679 声望114 粉丝