I’m currently trying to write a simple script that looks in a folder, and returns a list of all the file names in an RSS feed. However I’ve hit a major wall… Whenever I try to read filenames with Japanese characters in them, it shows them as ?’s. I’ve tried the solutions mentioned here: php readdir problem with japanese language file name – however they do not work for some reason, even with:
header('Content-Type: text/html; charset=UTF-8');
setlocale(LC_ALL, 'en_US.UTF8');
mb_internal_encoding("UTF-8");
At the top (Exporting as plain text until I can sort this out).
What can I do? I need this to work and I don’t have much time.
You can do it in PHP. Write a small C program to read directories and call that program from PHP.
See also:
http://en.literateprograms.org/Directory_listing_(C,_Windows)
http://www.daniweb.com/forums/thread74944.html
http://forums.devshed.com/c-programming-42/reading-a-directory-in-windows-36169.html