Php processing of Chinese files and folders in php file UTF-8 format, file_exists need Chinese encoding format for gbk? Therefore, you can use $ path = iconv ('utf-8', 'gbk', '/data/wwwroot/dvis/cp/video/test directory php to process Chinese files and folders.
In PHP file UTF-8 format,
In file_exists, the Chinese encoding format is gbk?
Therefore
$ Path = iconv ('utf-8', 'gbk', '/data/wwwroot/dvis/cp/video/test directory/level 2 directory/ .mp4 ');
This format is converted to gbk encoding.
This path can be determined by file_exists.
But I found a problem. when I want to move the file to another folder
Rename ($ path, $ dst); returns false and cannot be moved and renamed
If the target is English and only the file name is Chinese, the rename can be executed.
If it is like the above path, it will not work.
Replace copy ($ path, $ dst); and then run unlink ($ path). The original file cannot be deleted.
?
It can be understood that the rename unlink operation cannot target Chinese folders or Chinese files. ,
The specific cause has not been found. first write a blog record
?
I wiped it for a long time, and it turned out to be due to permission issues. LINUX. Filezilla is an ftp tool that has poor support for Chinese characters. as a result, folder permissions cannot be changed, so you have never paid attention to permissions.