I have the following code:

```
$files = ftp_nlist($conn_id, "/path/to/files");
$zip = new ZipArchive;
$res = $zip->open('filename.zip', ZipArchive::CREATE);
if ($res === TRUE) {
    foreach ($files as $item) {
        if ($item != '.' && $item != '..') {
            // Get file contents
            ob_start();
            @ftp_get($conn_id, "php://output", "/path/to/files/{$item}", FTP_BINARY);
            $data = ob_get_contents();
            ob_end_clean();
            $zip->addFromString($item, $data);
        }
    }
// ...
}

```

Unfortunately the file names in the zip file get corrupted. For example, ßäÄçö.txt becomes +ƒ+ñ+ä+º+¦.txt.

I am assuming this can be solved by using `iconv`, but I can't find any encoding pair that yields the desired result. As far as I know the file name is stored as UTF-8. When I don't zip the file but just download it using

```
// ...
header("Content-Disposition: attachment; filename*=UTF-8''".rawurlencode($item));
//...
echo $data;

```

there is no character corruption.