I received a ZIP file from a Japanese customer.
When I try to unzip it the file and folders names are messed up:
$ unzip ~/Downloads/【新入荷ECM】資料.zip ... inflating: БyРVУ№Й╫ECMБzОСЧ┐/123_ГЖБ[ГXГPБ[ГX.xlsx
What is the problem, and how to avoid it?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
The solution is to use the
-O shift-jis option in your command:
$ unzip -O shift-jis ~/Downloads/【新入荷ECM】資料.zip ... inflating: 【新入荷ECM】資料/123_ユースケース.xlsx
This way, the expanded files are perfectly readable in Ubuntu.
Simple answer for this
$ sudo apt install unar $ unar ~/Downloads/【新入荷ECM】資料.zip
unar can automatically recognize which encoding is used. It does only extract and not for compressing.
Then use 'convmv' to encode text after extract.
$ convmv -f shift_jis -t utf8 БyРVУ№Й╫ECMБzОСЧ┐/123_ГЖБ[ГXГPБ[ГX.xlsx --notest
Vice versa, if you'd like to create file(s) from utf8 into shift_jis text for windows.
$ convmv -f utf8 -t shift_jis <filename> --notest
Alternative answers, use of Ubuntu Japanese team built automatic encoding 'unzip' but you have to add repository.