Windows CMD is set to UTF-8 encoding

The default encoding of cmd under windows is GBK encoding, which may sometimes cause garbled characters. The following are the two methods I found to change the encoding method to UTF-8.

1. Temporary modification

(1) First enter the cmd command window (shortcut key win key + R)

(2) Directly input "chcp 65001" (change code page) and press the Enter key (Enter key) to execute. At this time, the encoding of the window is already UTF-8 encoding.

2. Permanent modification

(1) win key + R, enter regedit, confirm

(2) Find HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor in order

(3) Right-click - New, select "String Value"

 (4) Name it "autorun", right-click to modify, fill in the value data with "chcp 65001", and confirm

(5) When you open the cmd command window at this time, you will see that the encoding has been changed to UTF-8, just like the temporarily modified window before, and every time you open cmd, it is UTF-8 encoded. 

Reposted from: Study Notes - Windows CMD is set to UTF-8 encoding_windows setting utf8 encoding_Sleeping Gujiu's Blog-CSDN Blog 

Guess you like

Origin blog.csdn.net/fuhanghang/article/details/130803605