ID: 39660 Updated by: [EMAIL PROTECTED] Reported By: dominikseifert at yahoo dot de -Status: Open +Status: Wont fix Bug Type: *Directory/Filesystem functions Operating System: Any PHP Version: 5.2.0 New Comment:
Yes, you have to wait for PHP6 to get decent Unicode support. Previous Comments: ------------------------------------------------------------------------ [2006-11-28 14:39:25] dominikseifert at yahoo dot de 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 this bug report at http://bugs.php.net/?id=39660&edit=1