"Illegal byte sequence" when using unzip on macOS High Sierra to extract a file with Cyrillic characters
See original GitHub issueWhen trying to extract repacked.zip (created with SharpCompress)
with macOS unzip
(UnZip 6.00 of 20 April 2009, by Info-ZIP), the file with cyrillic characters in its name (Векторный смарт-объект-3.png
) fails to extract:
MacBook-Pro-Alex:_ alex$ unzip repacked.zip
Archive: repacked.zip
error: cannot create icredible_mockAPI_version/ICredible/Assets.xcassets/Images/who_rated_me.imageset/??????????????? ???+?????-?????????-3.png
Illegal byte sequence
The original zip archive containing the same file (likely compressed with macOS “Archive Utility”)
original.zip extracts with unzip
just fine.
This problem appeared since I have upgraded to macOS High Sierra (= was not present on macOS Sierra).
Is there anything we can do with the file encoding (i.e. use Unicode) to have it properly unzipped by macOS unzip
?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:9 (2 by maintainers)
Top Results From Across the Web
RE error: illegal byte sequence on Mac OS X
A sample command that exhibits the symptom: sed 's/./@/' <<<$'\xfc' fails, because byte 0xfc is not a valid UTF-8 char.
Read more >unzip archive with filenames containing umlaut - Ask Different
The unzip command on a terminal fails to create such files, complaining about an illegal byte sequence. How can I fix that issue?...
Read more >unzip cannot create non-utf8 files on APFS
I only wanted to convert the filenames during extraction, not the file content. I use iconv/recode/uconv as you suggested for the content ...
Read more >sed gives “illegal byte sequence” error when trying to ...
I am using the “Terminal” in Mac OS X 10.10 (Yosemite) and I am trying to delete all occurrences of a from a...
Read more >Opening the Dynalist backup files results in "Illegal byte ...
Unzip a Dynalist backup (after Dec 26 2018) file, either the txt or opml version. Expected result. The zip file should get unzipped....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Use
open
, as inopen fileWithUnicodeCharacters.zip
. It looks likeopen
will call an internal OS X program that has no problem open these type of.zip
files.Replacing
unzip
utility used in our script withditto
as suggested here fixed the problem.