-
Notifications
You must be signed in to change notification settings - Fork 64
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
Minor fixes and X-Archive-Charset + Unicode Path patch #4
Conversation
Hi Tony, Very cool! This looks really good. A couple comments:
|
Ok, I'll see if I can add the tests today. |
Thanks. On FreeBSD iconv depends (in turn) on Perl. I would prefer that mod_zip not depend on having a Perl installation. I know Nginx has its own charset conversion facilities (used in the Charset module). Although they are primitive, perhaps they could be used as a fallback when iconv is not present. |
|
Well, it seems that to test this thing I need to be able to extract files with names in different encodings. It does work if I use UTF8, but that's kind of expected, isn't it? But if I use, say CP866 (which is used by default in russian edition of MS Windows, which in turn is the reason of all this mess), then Perl::Zip is unable to read the filenames in the archive correctly. To be honest, even unzip-6.0 shows lots of "?????" instead of cyrillic letters. |
Ah, I was looking at the "iconv" utilities package -- my bad. So then depending on libiconv is OK with me, as long as you update the "config" file to test for it during configure. See here for an example that tests for libMagickWand: https://github.com/evanmiller/nginx_circle_gif/blob/master/config I don't mind requiring unzip 6.10a for the test suite, as long as your print a warning if it's not present. |
The point is that on Linux libiconv is not needed at all. |
Hi Tony, OK, I think I have a start. If you add this to config: ngx_feature="iconv_open()" ...then NGX_ZIP_HAVE_ICONV will be defined if iconv is present (on Linux... but not in library form). If we then #ifdef NGX_ZIP_HAVE_ICONV around the iconv stuff, then stuff should "just work" out of the box for everyone. Still need to figure out how to test the platform and then add: ngx_feature_libs=-liconv ...if we're not running on Linux. |
I think this config file will do the trick:
|
I have pulled in your changes and #ifdef'd around the iconv stuff so mod_zip always compiles. You should test out what I did. If everything looks OK, this will ship in the next version. |
Thanks a lot, I'll take a look. |
Hello Evan.
I've added a crude implementation of Unicode Path extra field along with ability to control the charset of original filenames.
As far as I understand, that exactly what the person here: https://github.com/evanmiller/mod_zip/issues#issue/3 is asking for.
The only problem now is that the Unicode Path thing IS added and the archive is correctly opened by unzip and arK, BUT I still can't see Unicode filename, so it either doesn't really work, or unzip/arK ignore it for some reason.
I would appreciate if you look at the patches and (hopefully) pull them if they look good for you. If they don't - any comment would be still appreciated.
Thanks in advance.