|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55837 Glob skips utf8 file names after setlocale en_US.UTF-8
Submitted: 2011-10-03 15:34 UTC Modified: 2021-08-15 04:22 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: php at maisqi dot com Assigned: cmb (profile)
Status: No Feedback Package: Filesystem function related
PHP Version: 5.3.8 OS: CentOS release 5.7 (Final)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php at maisqi dot com
New email:
PHP Version: OS:


 [2011-10-03 15:34 UTC] php at maisqi dot com
The title says it all. I think it will be faster if you run the test I attached.
Gunzip the archive on a Linux Server and run glob-locale-test.php.

You can see it directly on

Test script:
See the script on the attached archive (glob-locale-test.php).
It tries to list the files on the associated folder (that is also on the archive) three times.

1. The first one uses glob with the default locale.
2. The second, also uses glob but after the locale has been set to en_US.UTF-8.
3. The third, uses DirectoryIterator.

Expected result:
All tries should list 5 files.

Actual result:
The second try only prints the file with a ascii file name.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-03 15:38 UTC] php at maisqi dot com
Please download the archive from:
 [2011-10-04 10:39 UTC]
This behavior is common to several filesystem functions (see basename()). If the filenames were indeed encoded in UTF-8, there would be no problems.
 [2021-08-03 13:42 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-03 13:42 UTC]
Neither the test script nor the tarball are still available; if
this is still an issue for you with any of the actively supported
PHP versions[1], please make them available again.

> This behavior is common to several filesystem functions (see
> basename()).

I don't see the correlation, since basename() is *not* a file
system function in the sense that it would actually interact with

[1] <>
 [2021-08-15 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 19 10:03:36 2021 UTC