Bug #62119 [Com]: basename broken with non-ASCII-chars

From: Date: Mon, 04 Aug 2014 10:36:05 +0000
Subject: Bug #62119 [Com]: basename broken with non-ASCII-chars
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186959@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62119&edit=1 ID: 62119 Comment by: bugs dot php dot net at dw-perspective dot org dot uk Reported by: thomas dot hebinck at digionline dot de Summary: basename broken with non-ASCII-chars 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: I have this problem too, on a Fedora 20 (=current) system. Interestingly, the system's "basename" binary, which I'd assume is making the same glibc call, does not have this problem: # LANG=C basename '/test/äaä.txt' äaä.txt So perhaps the problem is more subtle that a simple glibc bug? Previous Comments: ------------------------------------------------------------------------ [2012-07-03 15:29:18] pollita@php.net 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#186959) next »