Problem
In the cmd window curl www.baidu.com
you can see the phenomenon of Chinese garbled, because GBK encoding is used by default. In addition, curl is an open source file Transfer tool that works with URL syntax in the command line mode. It is widely used in Unix, multiple Linux distributions, and has a ported version of DOS and Win32, Win64, with inline curl in win10 cmd.
C:\Users\lewis.liu>curl www.baidu.com<!DOCTYPE html><!--STATUS OK-->
WorkaroundIn the cmd window, enter:
CHCP 65001
Enter the top of the Curl command again, you will find no longer Chinese garbled. However, this method only has effect on the current CMD window, if you exit the current window to reopen cmd, you will find still Chinese garbled. If you want to solve this problem at once, you need to modify the registry. This method does not say here, interested can see the reference link below.
CHCP is a computer instruction that can display or set the active code page number.
Code page description
65001 UTF-8 code page
950 Traditional Chinese
936 Simplified Chinese default GBK
437 MS-DOS American English
The current code page encoding can be viewed via the right-click cmd window and by clicking Properties.
Reference links
- Use the Curl Command && Common Curl command under Windows
- Workaround for Windows console cmd garbled
CMD-command Line window Chinese garbled