Php cannot read Chinese image files. encoding error: PHPcode & lt ;? Php?imagethumbnail .jpg; $ percent0.05; $ imgetimagesize ($ image); $ width $ im [0]; $ hight $ im [1]; switch ($ im [2]) {case1: [email & #160; protected] ($ php cannot read Chinese image files, encoding problems
PHP code
The result of creating a Chinese name is garbled .. Php is UTF-8,
------ Solution --------------------
We recommend that you do not use Chinese names.
------ Solution --------------------
We recommend that you use the iconv function to convert the file name to gbk.
------ Solution --------------------
Php itself does not support Chinese characters.
The procedure is as follows:
$ Image = iconv ("UTF-8", "gb2312", $ image );
The first parameter is the input character encoding, the second is the character encoding you want to convert, and the third is the converted string.
------ Solution --------------------
Save the php file. Note the saved encoding
------ Solution --------------------
The best way is to stop using Chinese.
------ Solution --------------------
It is best to use UTF-8 in windows and explicitly declare that no matter whether it is a static page or not, do not use a Chinese name.