From:             ppmm at wuxinan dot net
Operating system: Windows 2000 Prof.
PHP version:      5.0.0
PHP Bug Type:     Filesystem function related
Bug description:  basename() has problem in supporting multi-byte chars.

Description:
------------
when path has multi-byte chars, basename() does not return correct file
basename. I did not have this problem in PHP 4.3.7. In the example, $hehe
variable has two gb2312-encoded chinese chars. This might relate to
setlocale or something like that.

Reproduce code:
---------------
$hehe = "hehe/�պ� haha kkk";
echo basename($hehe)."\n";
echo substr($hehe, strrpos($hehe, "/")+1);

Expected result:
----------------
�պ� haha kkk
�պ� haha kkk

Actual result:
--------------
 haha kkk
�պ� haha kkk

-- 
Edit bug report at http://bugs.php.net/?id=29542&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29542&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29542&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29542&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29542&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29542&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29542&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29542&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29542&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29542&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29542&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29542&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29542&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29542&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29542&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29542&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29542&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29542&r=float

Reply via email to