Bug #37738 [Com]: basename does not work with Japanese
| From: | fleshgrinder at gmx dot at | Date: | Wed, 30 Oct 2013 15:10:56 +0000 |
| Subject: | Bug #37738 [Com]: basename does not work with Japanese | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182500@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=37738&edit=1
ID: 37738
Comment by: fleshgrinder at gmx dot at
Reported by: joey at alegria dot co dot jp
Summary: basename does not work with Japanese
Status: Not a bug
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Fedora Core 4
PHP Version: 5CVS-2006-06-08 (CVS)
Block user comment: N
Private report: N
New Comment:
Just gave the following a test with PHP 5.5.5:
<?php
echo
basename(__DIR__ . "/english.txt") , PHP_EOL ,
basename(__DIR__ . "/æ¥æ¬èª.txt") , PHP_EOL ,
basename(__DIR__ . "/ελληνικά.txt") , PHP_EOL ,
basename(__DIR__ . "/english.txt", "txt") , PHP_EOL ,
basename(__DIR__ . "/æ¥æ¬èª.txt", "txt") , PHP_EOL ,
basename(__DIR__ . "/ελληνικά.txt", "txt") , PHP_EOL
;
?>
Everything was returned correctly by PHP, LC of the server was set to POSIX.
Previous Comments:
------------------------------------------------------------------------
[2013-09-15 10:20:38] kenji dot uui at gmail dot com
On PHP 5.5.1 Windows, I got the results below if I put "setlocale(LC_ALL,
'japanese');".
The full filename of the romanized file is /myfolder/roman_filename.txt.
The basename of the romanized file is roman_filename.txt.
The full filename of the Japanese file is
/myfolder/æ¥æ¬èªã®ãã¡ã¤ã«å.txt.
The basename of the Japanese file is æ¥æ¬èªã®ãã¡ã¤ã«å.txt.
------------------------------------------------------------------------
[2012-06-06 20:46:30] ion at 66 dot ru
we want to use many locales and we don't know locale of filename before user add file. how we
can use this filenames without transliteration?
------------------------------------------------------------------------
[2011-04-11 00:19:45] cataphract@php.net
For better or worse, basename is affected by the locale. The encoding used in the filenames must
match the set locale.
Bogus.
------------------------------------------------------------------------
[2011-04-10 22:23:10] chx@php.net
I am reopening this as PHP 6 is not developed any more and the bug is still valid.
------------------------------------------------------------------------
[2006-06-08 06:37:11] derick@php.net
Won't fix in PHP 5. This will be implemented for PHP 6.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=37738
--
Edit this bug report at https://bugs.php.net/bug.php?id=37738&edit=1