Skip to content
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

Support ignoring Language Encoding flag #521

Conversation

eliandoran
Copy link
Contributor

I am working on a tool which has to generate ZIP files reproducibly and I had to make it backwards compatible with an older version of the tool written in Rust.

The files generated by the Rust-based tool have:

0006 General Purpose Flag  0000

The ones generated by zip.js have:

0006 General Purpose Flag  0800
     [Bit 11]              1 'Language Encoding'

I saw that in zip-writer.js the language encoding bit was always set to 1. I chose to add a new option called useUnicodeFileNames to disable this flag. I made the flag true by default to avoid any backward compatibility issues.

Not sure if the name is very appropriate since it implies more than just setting a flag in the header, so I'm open to suggestions. I thought of includeLanguageEncodingHeader, but I thought it's too technical.

Additionally, I see some discussions were held regarding UTF-8 handling of file names in #131 but for reading and not writing.

@gildas-lormeau gildas-lormeau merged commit 09fdd44 into gildas-lormeau:master Jul 31, 2024
@gildas-lormeau
Copy link
Owner

I agree that this option is useful, especially in the case you mentioned. The name useUnicodeFileNames is fine to me. It's available in version 2.7.48, which I've just released. Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants