I have a php script running, which loops through all files in a specified directory. It returns name, filesize, modified_date etc. for each file it finds. The script returns
I've encountered this before; file system encoding is difficult and hard to predict, but this usually works for me:
stat(iconv('UTF-8', 'ISO-8859-1', $filename));
It just converts the filename from utf8 to iso8859-1 and tries.
This is tricky though, just look at this page for a juicy dialog in the post comments: http://www.rooftopsolutions.nl/blog/filesystem-encoding-and-php