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

JlCompress UTF-8 support #211

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

JlCompress UTF-8 support #211

wants to merge 3 commits into from

Conversation

cen1
Copy link
Collaborator

@cen1 cen1 commented Oct 20, 2024

Initial attempt to address #114

Two issues to resolve

  1. zip.setUtf8Enabled needs to be called before QuaZip::open to have any effect. Some JlCompress methods have QuaZip* zip as an input so passing a different Option there makes no difference. It could confuse someone who would expect this to be set either way, not the best API..

  2. Current integration tests do not really seem to test UTF-8 support (at least on Linux). Whether UTF-8 is enabled or not, the tests pass (see for example TestQuaZipFile::zipUnzip(), changing the flag makes no difference). Need to investigate why that is and test for negative example.

@cen1
Copy link
Collaborator Author

cen1 commented Oct 20, 2024

Nevermind, number 2 is obvious. If UTF8 is not explicitely set, it will use platform? QTextCodec which on Linux is UTF8 so there is obviously no difference. I suspect the fact that most of the tests pass across platforms simply means that default codecs can handle UTF8 so it really does not matter.

To get a negative test we need to explicitely set a codec that won't be able to handle the filename.

I think we also need some cross OS tests where we zip on each platform and unzip on others. That is 6 tests per combo so need to be careful not to explode the matrix but probably worth doing at least the basic combinations (text codec, encryption, levels).

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.

1 participant