Bug #55837 [Opn->Fbk]: Glob skips utf8 file names after setlocale en_US.UTF-8

From: Date: Tue, 03 Aug 2021 13:42:56 +0000
Subject: Bug #55837 [Opn->Fbk]: Glob skips utf8 file names after setlocale en_US.UTF-8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235566@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55837&edit=1 ID: 55837 Updated by: cmb@php.net Reported by: php at maisqi dot com Summary: Glob skips utf8 file names after setlocale en_US.UTF-8 -Status: Open +Status: Feedback Type: Bug Package: Filesystem function related Operating System: CentOS release 5.7 (Final) PHP Version: 5.3.8 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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 files. [1] <https://www.php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2011-10-04 10:39:04] cataphract@php.net This behavior is common to several filesystem functions (see basename()). If the filenames were indeed encoded in UTF-8, there would be no problems. ------------------------------------------------------------------------ [2011-10-03 15:38:14] php at maisqi dot com Please download the archive from: http://www.maisqi.com/glob-locale-test.tgz ------------------------------------------------------------------------ [2011-10-03 15:34:04] php at maisqi dot com Description: ------------ 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 http://www.maisqi.com/glob-locale-test.php 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55837&edit=1

« previous php.bugs (#235566) next »