From: maxime dot pacary at winsoft dot fr Operating system: Windows XP, 2003 PHP version: 5.0.5 PHP Bug Type: *Directory/Filesystem functions Bug description: scandir() and readdir() do not support Unicode filenames
Description: ------------ Hello PHP team, When I try to use scandir() and readdir() to get the content of a directory, if a file/dir name contains non iso-8859-1 characters, it is not retrieved correctly in PHP. e.g. (real dir name => result in PHP) test1 => test1 test2łćęśż => test2lcesz test3我很高兴 => test3???? chdir() does not work as well when trying to change to a directory containing such characters (error: no such file or directory) And when I just try to execute a PHP script in such a directory - I get the following errors : Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Warning: Unknown: Failed opening 'D:\MAX\Source\test\test4æå¾é«å ´\index.php' for inclusion (include_path='.;C:\php5\pear') in Unknown on line 0 I have tried using GB2312 and UTF-8 Content-Type headers (suggested by moriyoshi), and checked the "real" content of the retrieved string, but there are (e.g. for chinese) only '?' characters (ASCII 63), nothing else "hidden" by something like a wrong charset. Thank you for your attention, Frosty NB. I have already added this message as a comment for bug #30195, so if you want you can mark this bug as duplicate ; I have created a new bug, because when you add a comment to a bug already in 'No feedback' status, its status does not change so the bug remains 'buried' in the deep darkness of the bugs waiting for feedback... It would be better if a bug status changes back to 'Open' or 'Feedback' when a comment is added... Thank you, Frosty -- Edit bug report at http://bugs.php.net/?id=34574&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34574&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34574&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34574&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34574&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34574&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34574&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34574&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34574&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34574&r=support Expected behavior: http://bugs.php.net/fix.php?id=34574&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34574&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34574&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34574&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34574&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34574&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34574&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34574&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34574&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34574&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34574&r=mysqlcfg