KnpLabs / Gaufrette

PHP library that provides a filesystem abstraction layer − will be a feast for your files!
http://knplabs.github.io/Gaufrette
MIT License
2.47k stars 355 forks source link

Zip filename encoding #257

Open damien-biasotto opened 10 years ago

damien-biasotto commented 10 years ago

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.

l3l0 commented 10 years ago

@damien-biasotto Thanks for report. I will try to reproduce it.

real34 commented 10 years ago

Any updates with this issue? @l3l0 could you reproduce it?

real34 commented 10 years ago

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:

... 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.