Edit report at https://bugs.php.net/bug.php?id=62119&edit=1

 ID:                 62119
 Updated by:         poll...@php.net
 Reported by:        thomas dot hebinck at digionline dot de
 Summary:            basename broken with non-ASCII-chars
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            *Directory/Filesystem functions
 Operating System:   Linux/Ubuntu
 PHP Version:        5.3.13
 Block user comment: N
 Private report:     N

 New Comment:

Verified on Debian, but since this is the behavior of the underlying libc 
implementation, I'm not sure it's PHP's role to fix it.

Leaving open for now since we could potentially detect this case and deal with 
it, 
but on initial look I'm inclined to push it off on the OS.


Previous Comments:
------------------------------------------------------------------------
[2012-05-23 08:38:45] thomas dot hebinck at digionline dot de

Description:
------------
With the default locale setting "C", basename() drops non-ASCII-chars at the 
beginning of a filename.

Test script:
---------------
$path='/test/äaä.txt';
echo $path."\n";
setlocale(LC_ALL,'C');
echo dirname($path).'/'.basename($path)."\n";
setlocale(LC_ALL,'en_US.iso885915'); // bash: locale -a
echo dirname($path).'/'.basename($path)."\n";


Expected result:
----------------
/test/äaä.txt
/test/äaä.txt
/test/äaä.txt

Actual result:
--------------
/test/äaä.txt
/test/aä.txt
/test/äaä.txt



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62119&edit=1

Reply via email to