I need to work with files having accented characters in their name. Unfortunately, it looks like GLOB ignores these files. I have created this short code for the demonstration:
$files = glob(dirname(__FILE__) . "/data/tracks/167/*.*");
foreach($files as $file) {
var_dump($file);
var_dump(file_exists($file));
}
Output is:
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:13:string 'D:\data\zdroje\Kombinovane\MotoQuest\Web\admin/data/tracks/167/162_P1030721 (kopie).jpg' (length=87)
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:14:boolean true
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:13:string 'D:\data\zdroje\Kombinovane\MotoQuest\Web\admin/data/tracks/167/162_tn_P1030721 (kopie).jpg' (length=90)
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:14:boolean true
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:13:string 'D:\data\zdroje\Kombinovane\MotoQuest\Web\admin/data/tracks/167/1_1493222210_P1030721.jpg' (length=88)
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:14:boolean true
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:13:string 'D:\data\zdroje\Kombinovane\MotoQuest\Web\admin/data/tracks/167/1_1493222210_tn_P1030721.jpg' (length=91)
D:\data\zdroje\Kombinovane\MotoQuest\Web\admin\pokus.php:14:boolean true
My directory contains 6 files - the 2 with accented characters are ignored.:
The same is with file_exists, even, when I use hints listed here - PHP file_exists with accent returns false.
One of the filenames is:
1_1493385948_tn_22-Ještěd21.jpeg
Any idea, what's wrong?