how to iterate over non-English file names in PHP

Posted by Sabya on Stack Overflow See other posts from Stack Overflow or by Sabya
Published on 2010-06-01T07:30:03Z Indexed on 2010/06/01 7:33 UTC
Read the original article Hit count: 307

I have a directory which contains several files, many of which has non-english name. I am using PHP in Windows 7.

I want to list the filename and their content using PHP.

Currently I am using DirectoryIterator and file_get_contents. This works for English files names but not for non-English (chinese) file names.

For example, I have filenames like "?? ?? ?????????.eml", "hello ??????.eml".

  1. DirectoryIterator is not able to get the filename using ->getFilename()
  2. file_get_contents is also not able to open even if I hard code the filename in its parameter.

How can I do it?

© Stack Overflow or respective owner

Related posts about php

Related posts about directoryentry