php cmd solution to print Chinese garbled characters: 1. Create a php script; 2. Execute the cmd command in the script to modify the current page number character set.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
php cmd prints Chinese garbled characters What should I do?
Using the command line to execute the php script outputs garbled characters
Today, when I execute the php script in cmd or shellpower on the Windows platform, the Chinese output will be garbled .
Finally I thought of a solution, which is to execute the cmd command in the php script to modify the current page number character set
Copy after login
If other encodings are based on Change the ones below yourself!
chcp 65001 is to change to UTF-8
chcp 936 can be changed back to the default GBK
chcp 437 is American English
Recommended learning: "PHP video tutorial》
The above is the detailed content of What to do if php cmd prints Chinese garbled characters. For more information, please follow other related articles on the PHP Chinese website!