Working with Japanese filenames in PHP 5.3 and Windows Vista?(在 PHP 5.3 和 Windows Vista 中使用日语文件名?)
问题描述
我目前正在尝试编写一个在文件夹中查找的简单脚本,并返回 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 中使用日语文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 PHP 5.3 和 Windows Vista 中使用日语文件名?


- PHP - if 语句中的倒序 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01