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

Select OEM code page for .zip archives based on system locale #4

Open
unxed opened this issue Jul 16, 2020 · 0 comments
Open

Select OEM code page for .zip archives based on system locale #4

unxed opened this issue Jul 16, 2020 · 0 comments

Comments

@unxed
Copy link

unxed commented Jul 16, 2020

As my investigation shows, .zip archives created on dos/windows use OEM charset corresponding to system locale. So to open them correctly without manual charset seletion we should implement the following logic:

  1. Does .zip file have UTF8 flags? Assume UTF8.
  2. Has .zip file been created on dos/windows ("0" or "11" in HostOS field)? If so, assume OEM.
  3. Assume UTF8 (it's probably archive created on Mac OS X with UTF8 flag not set, but actually UTF8).

As for OEM code page, we may select it based on system locale as windows does. Code pages table can be taken from wine.

Wrote a patch for p7zip implementing this logic. It is very simple. Hope it can be easily ported to unar.
https://github.com/unxed/oemcp/blob/master/p7zip_oemcp_ZipItem.cpp.patch

Original discussion: mate-desktop/engrampa#5

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

No branches or pull requests

1 participant