|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60554 basename() broken with Spanish locales
Submitted: 2011-12-18 16:06 UTC Modified: 2011-12-21 15:59 UTC
Avg. Score:2.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.4.0RC3 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
37 + 26 = ?
Subscribe to this entry?

 [2011-12-18 16:06 UTC]
See test script.

Test script:
LANG=es_ES php -r 'var_dump(basename("高&执&行&力&的&打&造.xls"));'

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-21 15:59 UTC]
basename() features this warning:

basename() is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set using the setlocale() function.

As I understand, you're passign it utf-8 data while setting the locale to something else; this is not allowed.
 [2011-12-21 15:59 UTC]
-Status: Open +Status: Bogus
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Mar 08 10:01:23 2021 UTC