#37268 [NEW]: basename() doesnt work with non-latin first letters of the file.
| From: | spam dot bugs dot php dot net at vano dot org | Date: | Mon, 01 May 2006 23:56:42 +0000 |
| Subject: | #37268 [NEW]: basename() doesnt work with non-latin first letters of the file. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-96461@lists.php.net to get a copy of this message | ||
From: spam dot bugs dot php dot net at vano dot org
Operating system: Fedora Core 4
PHP version: 5.1.2
PHP Bug Type: Filesystem function related
Bug description: basename() doesnt work with non-latin first letters of the file.
Description:
------------
If a file starts with a non-latin letter (cyrillic) and not with a
non-letter character, basename will cut off the beginning of name untill a
latin letter or a non-letter character found in the name.
In my tests I was using Windows-1251 (CP1251) encoding and not UNICODE,
so, the problem is in basename() function itself not in multi-byte
charsets.
P.S. if you have problem with text encoding of the example below, you can
see a realtime example and test your own inputs there:
http://examples.vano.org/basename.php
Reproduce code:
---------------
<?php
echo basename("/test/blah/music/ðóññêèélatin.mp3");
?>
Expected result:
----------------
ðóññêèélatin.mp3
Actual result:
--------------
latin.mp3
--
Edit bug report at http://bugs.php.net/?id=37268&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37268&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37268&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37268&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37268&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37268&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37268&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37268&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37268&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37268&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37268&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37268&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37268&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37268&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37268&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37268&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37268&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37268&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37268&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37268&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37268&r=mysqlcfg