How Bat displays Chinese characters correctly

Problem Description

Sometimes when we use bat, Chinese characters cannot be displayed, and garbled characters will appear, as shown below:

Chinese

Solution

This is because we did not set the Bat encoding method, generally the default is UTF-8

Set the encoding format of the Bat to ANSI : select 文件/另存为, then modify the encoding method and save:

ANSI
Execute again at this time, and you will find that accurate Chinese characters can be displayed...

Chinese-echo

Guess you like

Origin blog.csdn.net/My_CSDN_IT/article/details/114095736