0

I'm trying to do something simple but it wont let me. I have this code:

$get = file_get_contents("resumé.html");

but I get this error msg:

Warning: file_get_contents(resumé.html): failed to open stream: No such file or directory in C:\wamp\www\mysite\index.php on line 36

It appears I cant open/read files with foreign/accented characters and I dont know why. I tried using functions like mb_convert_encoding() and urlencode() but they dont work..

So how am I supposed to do this without resorting to renaming my file to resume.html?

  • Your filesystem is probably using a different encoding than whatever you're using to enter that filename. Try `var_dump(glob('res*'));` to see what the filename looks like from PHP's perspective. That said, you should try to avoid non-ascii characters in filenames for simplicity's sake. – Sammitch Dec 14 '16 at 23:26
  • 3
    http://stackoverflow.com/questions/977635/how-to-open-file-in-php-that-has-unicode-characters-in-its-name and see "wfio" – BetaDev Dec 14 '16 at 23:30
  • Thank you Shailesh Singh for the wfio extension its great and works! – Stefan Djurcic Dec 15 '16 at 00:05

0 Answers0