Bug #67277 [Opn->Fbk]: glob ignores files with wrongly encoded chars

From: Date: Mon, 13 Sep 2021 08:14:23 +0000
Subject: Bug #67277 [Opn->Fbk]: glob ignores files with wrongly encoded chars
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236556@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67277&edit=1 ID: 67277 Updated by: cmb@php.net Reported by: l dot werner at sprengnetter dot de Summary: glob ignores files with wrongly encoded chars -Status: Open +Status: Feedback Type: Bug Package: Filesystem function related Operating System: Ubuntu 10.04 PHP Version: 5.4.28 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Is this still an issue for you with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2014-05-14 14:20:40] l dot werner at sprengnetter dot de Description: ------------ We upload files with winscp to our server. On the server we have an script which imports these files. Some of the files have german umlauts. These are somewhat wrongly encoded. When I try to use glob to read all files in an dir with such an file this file will be silently ignored. Test script: --------------- > ls -l total 972 -rw-r--r--+ 1 dholler dholler 69288 2014-04-08 12:21 00442_115_102_GBA.pdf -rw-r--r--+ 1 dholler dholler 211968 2014-04-08 12:27 00442_305_31_ueber_2013_1[1].xls -rw-r--r--+ 1 dholler dholler 19523 2014-04-08 14:55 00442_325_32_stob3_2013_1_1_.xlsx -rw-r--r--+ 1 dholler dholler 142640 2014-04-25 09:35 00442 BV-001.jpg -rw-r--r--+ 1 dholler dholler 120271 2014-04-25 09:35 00442 BV-002.jpg -rw-r--r--+ 1 dholler dholler 277317 2014-04-23 08:20 00442 Einverst?ndniserkl?rung.pdf -rw-r--r--+ 1 dholler dholler 124950 2014-04-25 09:31 00442 SolumGBA.pdf -rw-r--r--+ 1 dholler dholler 17920 2014-04-25 09:42 Thumbs.db > echo '<?php print_r(glob("*"));' | php Array ( [0] => 00442_115_102_GBA.pdf [1] => 00442_305_31_ueber_2013_1[1].xls [2] => 00442_325_32_stob3_2013_1_1_.xlsx [3] => 00442 BV-001.jpg [4] => 00442 BV-002.jpg [5] => 00442 SolumGBA.pdf [6] => Thumbs.db ) Expected result: ---------------- File will not be ignored an i get an error message or even better the file can be handled. Actual result: -------------- File is ignored. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67277&edit=1

« previous php.bugs (#236556) next »