|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [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 09:01:23 2021 UTC