Home > Article > Backend Development > Garbled characters appear in Chinese file names uploaded by php
1. The PHP upload file database saves files with normal Chinese file names. You can go to the server to check that the Chinese file names are garbled. I am puzzled and ask for help from Baidu.
2. Mainly due to inconsistent encoding during uploading. Garbled characters
3. It turns out that you only need to do this when moving_uploaded_file
move_uploaded_file($_FILES["file"]["tmp_name"],iconv("UTF-8",
"gb2312", "photo/".$_FILES["file"]["name"]))
The above has introduced the garbled Chinese file name uploaded by PHP, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.