I've got files containing the character ⌐ in their name.
These files are well handled under Linux (Apache/php):
$files = scandir($path);
echo json_encode($files);
file1⌐
file2⌐
file3⌐
file4⌐
Under Windows they seem to be read as Windows-1252 by the file system, so I had to conditionally convert them so that json_encode could work
$files = scandir($path);
foreach ($files as $i => $file) {
$files[$i] = mb_convert_encoding($file, 'UTF-8', 'Windows-1252');
}
echo json_encode($files);
Here is how they get converted
file1¬
file2¬
file3¬
file4¬
Why ⌐ is getting converted to ¬ and how can I get the original character ?