I have zip file which contains photo with filename "test1ąąążżżźźźźććć.jpg", as you can see it contains only special characters from Polish language. When I'm trying to extract it with PHP code it returns filename "test1ÑÑÑ╛╛╛½½½½ååå.jpg". But when I'm extracting filenames with special characters from more than one language like "test2óôśšźżžøùú.jpg" (in this filename Polish char is included too) it's working good with no problems. So it looks like in most cases PHP zip extracting crashes only with Polish language filenames.
Here is the code that I used to extract zip files:
function extractZip($file, $path=NULL) {
if($path == NULL)
$path = pathinfo(realpath($file), PATHINFO_DIRNAME);
$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE) {
$zip->extractTo($path);
$zip->close();
echo "Ok, $file extracted to $path";
} else {
echo "Error";
}
}
extractZip('test.zip');
I'm sure that is not problem with my system or zip file. When I extracted zips by regular windows explorer not by script everything worked good. Please help, I tried a lot of methods and searched through the web and I have no idea how to solve it.