Gaufrette
Gaufrette copied to clipboard
Zip filename encoding
What's wrong :
Get a zip archive with utf8 filename and exotic chars (éàçù) inside of it, when you extract the archive, filenames are a bit broken due to encoding issue. Even with mb_convert_encoding() on filename.
How to reproduce :
Generate a zip archive with exotic chars in its filename, add files in it (with also exotic chars on theirs filenames). Save it, then unzip it, filenames are messed up.
What's expected :
filenames' of files should be identical before archive generation, and after extraction.
@damien-biasotto Thanks for report. I will try to reproduce it.
Any updates with this issue? @l3l0 could you reproduce it?
After searching a bit on the web it seems directly related to the zip extension. See the gist at https://gist.github.com/real34/9604201 for an illustration of the bug.
Since Gaufrette only acts as a wrapper oaround ZipArchive, what is your take on this? Other solutions have reimplemented Zip utils class, but I am not sure this is the way to go.
See further resources at:
- https://bugs.php.net/bug.php?id=51929
- https://bugs.php.net/bug.php?id=53948
- https://github.com/hit-moodle/moodle/commit/d892be1646b07f1fecf4dcf3cbb6f35fd4da2602
- http://stackoverflow.com/questions/20600843/php-ziparchive-non-english-filenames-return-funky-filenames-within-archive
- https://github.com/Grandt/PHPZip/commit/99e9a8688872f259d159375ca2eb6037204dfc6e
... seems fixed in PECL zip 1.11.0 : http://pecl.php.net/package-changelog.php?package=zip but I still could not make it work.
Feel free to close this issue if you consider this is a PHP thing and must not be handled by Gaufrette.