PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Aug 22, 2019 12:51 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Dec 03, 2010 8:34 am 
Offline
Forum Newbie

Joined: Fri Dec 03, 2010 8:18 am
Posts: 1
Hi,
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 :
Syntax: [ Download ] [ Hide ]
$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';
}


Any idea how can i solve this


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group