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

Allow setting charset for archive. #1966

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhanghai
Copy link

@zhanghai zhanghai commented Sep 10, 2023

This exposes archive.current_code so that the caller can explicitly specify a charset instead of relying on the default locale.

This is important for platforms like Android and iOS (and when compiled without iconv), because nl_langinfo isn't available before Android API 26, and on iOS nl_langinfo always returns US-ASCII. And the caller should be able to specify the charset they want to work with for each archive, instead of relying on a global state.

This change is updating the ZIP writing support to respect this per-archive charset when setting the UTF-8 flag as well.

Bug: #1572

This exposes archive.current_code so that the caller can explicitly specify a charset instead of relying on the default locale.

This is important for platforms like Android and iOS (and when compiled without iconv), because nl_langinfo isn't available before Android API 26, and on iOS nl_langinfo always returns US-ASCII. And the caller should be able to specify the charset they want to work with for each archive, instead of relying on a global state.

This change is updating the ZIP writing support to respect this per-archive charset when setting the UTF-8 flag as well.

Bug: libarchive#1572
@mmatuska
Copy link
Member

@kientzle what do you think of this?

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.

None yet

2 participants