Skip to content

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.

2 participants