note 86693 rejected from function.basename by thiago
| From: | thiago@php.net | Date: | Thu, 30 Oct 2008 03:16:20 +0000 |
| Subject: | note 86693 rejected from function.basename by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145960@lists.php.net to get a copy of this message | ||
Note Submitter: yarco dot w at gmail dot com
----
It seems there are some bugs in basename when dealing with Chinese.
It is very strange when cli and mod_php show different results.
===============
[yarco@localhost ~]$ php -v
PHP 5.2.4 (cli) (built: Oct 16 2007 09:13:35)
[yarco@localhost Public]$ php -r 'print
basename("/æçé³ä¹/é³ä¹.mp3");'
é³ä¹.mp3
===============
The result is right. But mod_php would cut all of it.
===============
[yarco@localhost Public]$ cat <<EOF > 1.php
> <?php
> print basename("/æçé³ä¹/é³ä¹.mp3");
> ?>
> EOF
[yarco@localhost Public]$ curl http://localhost/~yarco/1.php
.mp3
===============