-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the language encoding flag #1
Add support for the language encoding flag #1
Conversation
This allows to set the flag when creating a zip file, and to get back the value of the flag when reading a zip file. It doesn't do any encoding or decoding of the name and comment fields. This is also a very partial revert of 02889ff where the support for the language encoding flag was commented out in IO::Compress::Zip.
Hey Manfred Thanks for the patch. This feature has been on my todo list for a very long time. From memory, the primary reason support was removed was because there are a couple of ways to store a UTF8 filename/comment in a zip file. At the time I hadn't decided which method to use. The one used here is the most common, but I pulled support until I bottomed out on that analysis. In principle I'm ok with (finally) enabling this feature, but I need to take another quick look at the zip specs before I reinstate the change There are a few changes I'll need to make before this can be released into the wild
|
ReferencesAPPNOTE.TXT, APPENDIX D - Language Encoding (EFS)
|
[DELTA] 2.086 31 March 2019 * IO::Compress::Zip & IO::Uncompress::Unzip Added support for Language Encoding Flag via the EFS option. Starting point was pull request pmqs/IO-Compress#1 * zipdetails - some support for MVS (Z390) zip files * IO::Uncompress::Base Issue with trailing data after zip archive #128626 for IO-Compress: mainframe zip archive * t/cz-14gzopen.t cperl error found in http://www.cpantesters.org/cpan/report/448cafc4-3108-11e9-9b6b-d3d33d7b1231 Perl has this: "Not enough arguments for Compress::Zlib::gzopen" cperl uses this: "Not enough arguments for subroutine entry Compress::Zlib::gzopen" * Handlers being called when optional modules are not installed #128538: $SIG{__DIE__} * #128194: Beef up diag when system returns error * Moved source to github https://github.com/pmqs/IO-Compress * Add META_MERGE to Makefile.PL * Added meta-json.t & meta-yaml.t
I recently noticed that
IO::Compress::Zip
does currently not support setting the language encoding flag of a zip file member, which can result in file names with 'weird' characters when unpacking a zip file where the member names are UTF-8 encoded (for example with the Windows Explorer on Windows 7, but likely also with other tools).This pull request adds support for setting the flag when creating a zip file, and to get back the value of the flag when reading a zip file. It doesn't do any encoding or decoding of the name and comment fields.
This is also a very partial revert of 02889ff where the support for the language encoding flag was commented out in
IO::Compress::Zip
. Unfortunately, I couldn't find a reason why this was done.I've already prepared a branch in
Archive-Zip-SimpleZip
based on this, so should this get merged, I'm planning to create a pull request forArchive-Zip-SimpleZip
as well.