From: dominikseifert at yahoo dot de Operating system: Any PHP version: 5.2.0 PHP Bug Type: *Directory/Filesystem functions Bug description: no multibyte support for Directory/Filesystem function
Description: ------------ Directory/Filesystem functions do not work with multibyte-strings. When eg trying to open or move a file or directory with a chinese filename, the file or directory being accessed or created has a completely messed up name. Could not find a work-around. Reproduce code: --------------- // Multibyte support is enabled (UTF-8) // change this correspondingly for your FS $origFile = "c:/myfile.txt"; $chineseName = $_POST["filename"]; echo "name: " . $chineseName; echo "len: " . mb_strlen($chineseName); echo "sb-len: " . strlen($chineseName); $dir = dirname($origFile); rename($origFile, $dir . "/$chineseName") or die("Could not rename file: $origFile"); Expected result: ---------------- name: 中文字.txt len: 7 sb-len: 13 Actual result: -------------- Actual filename is: 䏿å.txt -- Edit bug report at http://bugs.php.net/?id=39660&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39660&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39660&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39660&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39660&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39660&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39660&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39660&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39660&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39660&r=support Expected behavior: http://bugs.php.net/fix.php?id=39660&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39660&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39660&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39660&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39660&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39660&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39660&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39660&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39660&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39660&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39660&r=mysqlcfg