简体   繁体   中英

Special characters in file name cannot be found

I have a list of files that I want to check if they exist with PHP Here is a screenshot of the list (using Options +Indexes)

在此处输入图片说明

In PHP, I tried

  • $name = iconv("utf-8", "utf-8//TRANSLIT", $name);
  • file_exists(mb_convert_encoding($name, "UTF-8"));
  • $name = iconv('utf-8', 'cp1252', $name);
  • $name = iconv('UTF-8', 'ISO-8859-1', $name);

None of them works...

By the way, it is a Linux server

EDIT :

I think I found a way to get to the solution. I need to transform the characters like "Sévère" into something like this "Se%CC%81ve%CC%80re%20". How can I do this conversion ?

您只需要URL编码utf-8。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM