php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37268 basename() doesnt work with non-latin first letters of the file.
Submitted: 2006-05-01 23:56 UTC Modified: 2015-03-12 08:39 UTC
Votes:19
Avg. Score:4.6 ± 0.6
Reproduced:16 of 17 (94.1%)
Same Version:8 (50.0%)
Same OS:5 (31.2%)
From: spam dot bugs dot php dot net at vano dot org Assigned:
Status: Wont fix Package: Filesystem function related
PHP Version: 5.1.2 OS: Fedora Core 4
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-05-01 23:56 UTC] spam dot bugs dot php dot net at vano dot org

Patches

UTF8 (last revision 2011-05-18 08:18 UTC) by vsz at ya dot ru)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-02 00:55 UTC] judas dot iscariote at gmail dot com
you have to wait PHP6, it will address this problems.
 [2010-07-31 23:21 UTC] daniel at mameso dot com
a workaround:

# workaround for splitting basename whith beginning utf8 multibyte char
function mb_basename($filepath, $suffix = NULL) {
	$splited = preg_split ( '/\//', rtrim ( $filepath, '/ ' ) );
	return substr ( basename ( 'X' . $splited [count ( $splited ) - 1], 
$suffix ), 1 );
}

have fun,
Daniel.

PS: the problem does not exist under MAC OSX 10.6.x with ZendServerCE 5.0 & 
PHP5.3
 [2015-03-12 04:20 UTC] vovan-ve at yandex dot ru
Are you sure this problem will be solved? http://3v4l.org/BWgUm
 [2015-03-12 08:39 UTC] mike@php.net
You need to set the correct locale for stdlib/multibyte functions to work correctly; anyway, 3v4l.org apparently only has C/POSIX locale available:

http://3v4l.org/M6jhm
 
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sat May 23 05:02:24 2015 UTC