|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41199 scandir etc cannot read Chinese file/folder name
Submitted: 2007-04-26 08:55 UTC Modified: 2016-08-08 10:03 UTC
Avg. Score:4.5 ± 1.1
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:2 (40.0%)
From: n00bp00ns at gmail dot com Assigned:
Status: Wont fix Package: Directory function related
PHP Version: 5.2.1 OS: Vista Home Premium
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-04-26 08:55 UTC] n00bp00ns at gmail dot com
The directory functions, namely:


only reads english filenames/folders and not chinese and possibly other languages


Reproduce code:

$path = "C:/"; // path to file on windows pc
$dir = opendir($path);

while (false !== ($f = readdir($dir)) )
	echo $f . "<br />";


Expected result:
Whatever filenames that is in that folder I requested for

Actual result:
If there are chinese filenames, it'll display as question marks. Not sure about others. I tried reencoding/sending the proper headers too.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-26 09:06 UTC]
You have to wait for PHP6 if you want decent Unicode support.
 [2016-08-08 10:03 UTC]
Fixed in PHP 7.1

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 21:01:30 2024 UTC