2

Whenever I extract a zip file using the ZipArchive class in PHP, the character encoding for both folders and files from the zip turns up wrong. (In my case Scandinavian letters like æ ø å).

$zip = new ZipArchive();
$res = $zip->open($target_path);
if ($res === true) {
    $zip->extractTo($extract_folder."/".$name[0]);
    $zip->close();
    unlink($target_path);
    }

The code works great for standard letters. Is there any way to specify encoding in this class? Or any alternative classes that do?

noSoup
  • 71
  • 4

0 Answers0