Skip to content

Cannot unzip because of foreign language

So I have a zip file that I have to unzip and cannot do so because I have some characters that are not english. The characters are these ones (ć and cyrilic version of this letter aswell). I have tried p7zip, unzip and none work for me. I have also enabled a few different locales that do contain these characters ( serbian that is ) but sadly still cannot extract it.

3 points5 comments
Open on Reddit
About this post
Posted
Archived
Score
3 · 100% up
Kind
Text
ID
nihlsc

Author

37
posts
83
comments
14
media
View profile

5 comments

Though there should be a way to get it to work with 7z, unarchiver has always worked with whatever language archive I've thrown at it, it may be easier to try that. Just unar *.zip

https://archlinux.org/packages/community/x86_64/unarchiver/

3 points

That just worked! Thanks.

1 points

Another solution, for those distributions that don't have unarchiver in their repository, would be:

bsdtar --options hdrcharset=cp437 -xvf file.zip

...but of course with the charset used in MS-DOS in your country instead of cp437. E.g. for Russia it would be cp866. The "bsdtar" program comes from libarchive.

The explanation is that zip archives have the filenames inside encoded in that DOS charset, and unzip hard-codes conversion from cp437 to ISO-8859-1. bsdtar allows you to specify the source charset, and gets the destination charset from the current locale. The Unarchiver guesses using Mozilla's "chardet" library, sometimes incorrectly.

5 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.