#34314 [Opn->Bgs]: function basename & pathinfo is wrong for chinese filename.

From: Date: Wed, 31 Aug 2005 07:38:37 +0000
Subject: #34314 [Opn->Bgs]: function basename & pathinfo is wrong for chinese filename.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84220@lists.php.net to get a copy of this message
ID: 34314 Updated by: sniper@php.net Reported By: neo at csba dot com dot cn -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: WIN2003 PHP Version: 5.0.4 New Comment: Use addslashes() on the filename. Previous Comments: ------------------------------------------------------------------------ [2005-08-31 09:24:17] neo at csba dot com dot cn Description: ------------ i use function basename and pathinfo proess chinese filename, $filename = "D:\\ftpserver\\Öм¶½ÖÇò½ÌѧµÚ¶þʮһÕÐ.wmv"; echo basename($filename); result is : .wmv $at = pathinfo($filename); echo $at['basename']; reseult is : .wmv is not Öм¶½ÖÇò½ÌѧµÚ¶þʮһÕÐ.wmv Reproduce code: --------------- $filename = "D:\\ftpserver\\Öм¶½ÖÇò½ÌѧµÚ¶þʮһÕÐ.wmv"; echo basename($filename); $at = pathinfo($filename); echo $at['basename']; Expected result: ---------------- Öм¶½ÖÇò½ÌѧµÚ¶þʮһÕÐ.wmv Actual result: -------------- .wmv ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34314&edit=1

« previous php.bugs (#84220) next »