1
votes

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)

enter image description here

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 ?

1
That image is huge, can you replace it with a smaller one?jerry
It depends on how your filesystem encodes the names, which depends on your system. What system are we talking about?deceze♦
See stackoverflow.com/questions/1525830/… - the .pdf filenames appear to be mangled when they have been stored on the windows file system.Adder
@ValehHajiyev : I tried that answer, it doesn't work...Kalzem

1 Answers

0
votes

You just need to URL encode the utf-8.