bat batch script Chinese garbled solution CMD

1. Convert the encoding method of the script file

By default, in the bat script file, if Chinese is not encoded in ANSI, garbled characters will appear.

Notepad opens the script file and saves it in ANSI encoding.

 

2. Change the code page

Declare the change code page in the original bat script file

code page mapped character set
936 GB2312
20127 US-ASCII
65001 UTF-8

 Because the page change code will cause the characters in the file to be garbled

The best solution is

Code page chcp 65001 File saved as UTF-8

Guess you like

Origin blog.csdn.net/simon4055/article/details/130104782