#29542 [NEW]: basename() has problem in supporting multi-byte chars.
| From: | ppmm at wuxinan dot net | Date: | Thu, 05 Aug 2004 21:42:36 +0000 |
| Subject: | #29542 [NEW]: basename() has problem in supporting multi-byte chars. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-64159@lists.php.net to get a copy of this message | ||
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