i try to create a zip file with several files.
when i add a file with non Latin characters in the filename(in my example greek letters), the result is that the file will successfully added to zip archive but with wrong filename. i tried to use several functions and charset combinations (like iconv, md_convert_encoding) but when i try to open the zip file with winZip or windows explorer i get the same error.
original filename Εικόνα024.jpg
filename in zip +ώΆ_Ίά024.jpg
my code :
Code: Select all
$zip = new ZipArchive;
$res = $zip->open("test.zip", ZIPARCHIVE::OVERWRITE );
if ($res === TRUE) {
$zip->addFile("test.txt");
$zip->addFile("Εικόνα024.jpg");
//here i tried several things but nothing seems to work
//$zip->addFile("Εικόνα024.jpg",iconv("ISO-8859-7","UTF-8","Εικόνα024.jpg"));
//$zip->addFile("Εικόνα024.jpg",iconv("ISO-8859-7","ISO-8859-1","Εικόνα024.jpg"));
//
$zip->close();
echo 'ok';
} else {
echo 'failed';
}