#33898 [NEW]: basename() misbehaves on multibyte characters
| From: | feldgendler at mail dot ru | Date: | Thu, 28 Jul 2005 08:59:56 +0000 |
| Subject: | #33898 [NEW]: basename() misbehaves on multibyte characters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-82573@lists.php.net to get a copy of this message | ||
From: feldgendler at mail dot ru
Operating system: Debian GNU/Linux i686
PHP version: 5.0.4
PHP Bug Type: Filesystem function related
Bug description: basename() misbehaves on multibyte characters
Description:
------------
The source code in my testcase is in UTF-8 encoding itself. The quoted
string contains Cyrillic letters. If I save the source code in KOI8-R
(single-byte) Cyrillic encoding, and change the second argument to
setlocale() to "ru_RU.KOI8-R", the observed result is what I expect. This
shows that the bug only occurs on multi-byte characters, because in KOI8-R
all characters are single-byte.
Relevant PHP configuration options:
--enable-mbstring=all
(--enable-zend-multibyte was not specified)
Relevant environment variables:
LANG=en_US.UTF-8
(LC_* are not set)
Reproduce code:
---------------
<?php
setlocale(LC_CTYPE, "en_US.UTF-8");
echo basename("english/ÒÕÓÓËÉÊ");
?>
Expected result:
----------------
ÒÕÓÓËÉÊ
Actual result:
--------------
english
--
Edit bug report at http://bugs.php.net/?id=33898&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33898&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33898&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33898&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33898&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33898&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33898&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33898&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33898&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33898&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33898&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33898&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33898&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33898&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33898&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33898&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33898&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33898&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33898&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33898&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33898&r=mysqlcfg