Direct execution in the PHP5.6 era
Php.exe file. php
That's not the problem
The Active code page command in the command line under win
Chcp
Modify
CHCP 936//GBK
CHCP 65001//utf-8
But executing php.exe under PHP 7.1 will first modify the command line's active code page
This is an automatic behavior program that comes with a chcp 65001 then your PHP file
When passed as a parameter if there is a Chinese character so sorry the program is garbled inside
Can't find the file on this issue in Baidu search almost no solution so in the PHP official website
Bug Feedback inside this page
https://bugs.php.net/bug.php?id=73716&edit=2
Probably in [2016-12-12 21:30 UTC] [email protected]
Solution:
Open PHP.ini Search internal_encoding and change to internal_encoding = "cp936"
default_charset= "UTF-8" should be the default, if not, add
This corresponds to the simplified Chinese Windows environment but the disadvantage of this scheme is that it is very dead.
If PHP is packaged and released, it's probably only possible to do it in a simple system.
After changing this, the PHP file is still written in UTF-8 code.
But the input path as a parameter is the contents of the ARGV variable remember to transcode into UTF-8
PHP file for Windows 7 PHP 7.1 command line execution in Chinese file name