Bug #41199 [Wfx]: scandir etc cannot read Chinese file/folder name
| From: | ab@php.net | Date: | Mon, 08 Aug 2016 10:03:40 +0000 |
| Subject: | Bug #41199 [Wfx]: scandir etc cannot read Chinese file/folder name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203070@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=41199&edit=1
ID: 41199
Updated by: ab@php.net
Reported by: n00bp00ns at gmail dot com
Summary: scandir etc cannot read Chinese file/folder name
Status: Wont fix
Type: Bug
Package: Directory function related
Operating System: Vista Home Premium
PHP Version: 5.2.1
Block user comment: N
Private report: N
New Comment:
Fixed in PHP 7.1
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2007-04-26 09:06:07] tony2001@php.net
You have to wait for PHP6 if you want decent Unicode support.
------------------------------------------------------------------------
[2007-04-26 08:55:32] n00bp00ns at gmail dot com
Description:
------------
The directory functions, namely:
opendir();
readdir();
scandir();
only reads english filenames/folders and not chinese and possibly other languages
Ref: http://bugs.php.net/bug.php?id=30195
Reproduce code:
---------------
<?php
$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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=41199&edit=1