Bug #54977 [NEW]: UTF-8 files and folder are not shown
| From: | andrea dot rizzini at slidepath dot com | Date: | Thu, 02 Jun 2011 12:15:57 +0000 |
| Subject: | Bug #54977 [NEW]: UTF-8 files and folder are not shown | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-161129@lists.php.net to get a copy of this message | ||
From:
Operating system: Window 7
PHP version: 5.2.17
Package: Filesystem function related
Bug Type: Bug
Bug description:UTF-8 files and folder are not shown
Description:
------------
Listing the content of a directory using the standard php functions does
not return any files or folders which have UTF-8 charcters.
Windows 7 Supports Unicode "UCS-2LE" so you can create any folder / files
like the following: (ç (king in Japanese) and æ±ãã¦æã (dirty dog
on Japanese)).
If you list the directory where you have these files you will get ?????,
?????.
After a bit of investigation I've noticed that PHP internally treats any
string literal in ISO8859-1.
I've tried to change the default encoding to UTF-8 in the php.ini but IT
DOES NOT WORK.
Test script:
---------------
Create several UTF-8 folders using chinese or japanese character.
List them using the standard php function opendir like:
$myDirectory = opendir(".");
// get each entry
while($entryName = readdir($myDirectory)) {
$dirArray[] = $entryName;
}
// close directory
closedir($myDirectory);
// count elements in array
$indexCount = count($dirArray);
Print ("$indexCount files<br>\n");
Notice that the UTF-8 encoded files are returned as ???????
Expected result:
----------------
It should return the full list of directoried including directories with
UTF-8 encoded name
Actual result:
--------------
It only return folders which have a characters contained in IS08859-1 .
--
Edit bug report at http://bugs.php.net/bug.php?id=54977&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54977&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54977&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54977&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54977&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54977&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54977&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54977&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54977&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54977&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54977&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54977&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54977&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54977&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54977&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54977&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54977&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54977&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54977&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54977&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54977&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54977&r=mysqlcfg