This is driving me crazy. I've read dozens of posts on the problem (on SO and elsewhere), but none of them seem to help me.
I have a directory of files:
file.pdf
another file.pdf
one-more-file.pdf
Корпусные воздухонагреватели.pdf
I want to loop through the files and get their last modified dates. I can successfully loop through the files using opendir or scandir. However when you get to the file with Russian/Cryillic characters... PHP won't get the last modified time. Instead it throws an error message of :
Warning: filemtime() [function.filemtime]: stat failed for ????????? ??????????????????.pdf in test.php on line 27
This is the same error you get when you pass a filename that doesn't exist.
I figure that I need to convert the string from some encoding to another... but everything I've tried with iconv has resulted in the same error.
PHP 5.3 is running on a Windows 7 machine (under Softaculous AMPPS). I can see the file names properly through Windows Explorer on the same machine.
UPDATE
On a whim, I transferred my script and a few of the files to my RedHat Linux server and it works fine there. So I'm guessing this has to either be a PHP, Apache, or Windows setting that is causing the problem.