Windows command line window cmd encoding settings

 

The default encoding of the windows command line window is GBK. When the UTF-8 encoded Chinese is output in the command line window, garbled characters will appear.

 

  

illustrate:

1. chcp does not follow any parameters to indicate the encoding used to view the current window.

2. The 936 here represents (GBK) encoding.

3. The type command outputs the contents of the specified file to the screen.

 

Modify the current window encoding

chcp New coding code, such as: chcp 65001

 

illustrate:

1. The code name 65001 represents UTF-8 encoding.

2. The modification only takes effect in the current window, and has no effect on the encoding of other windows.

 

 

 

 Reference: http://blog.csdn.net/freedom2028/article/details/16632215

 

 

 

 

 


 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326209186&siteId=291194637