問題描述
我目前正在嘗試編寫一個在文件夾中查找的簡單腳本,并返回 RSS 提要中所有文件名的列表.但是,我遇到了主要問題...每當我嘗試讀取包含日文字符的文件名時,它都會將它們顯示為 ?'s.我已經嘗試過這里提到的解決方案:php readdir question with japanese language file名稱 - 但是由于某種原因它們不起作用,即使是:
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.
推薦答案
您可以在 PHP 中完成.編寫一個小的 C 程序來讀取目錄并從 PHP 調用該程序.
You can do it in PHP. Write a small C program to read directories and call that program from PHP.
另見:http://en.literateprograms.org/Directory_listing_(C,_Windows)http://www.daniweb.com/forums/thread74944.htmlhttp://forums.devshed.com/c-programming-42/reading-a-directory-in-windows-36169.html
這篇關于在 PHP 5.3 和 Windows Vista 中使用日語文件名?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!