본문 바로가기

Error and Solve

[에러 해결] unzip할 때 한글이 깨지는 경우 / unar 패키지 사용

반응형

 

 

unzip with unicode files not working

 

 

 

unzip 명령어로 .zip 파일을 풀 때 한국어가 보존이 안되는 문제를 발견했다. 

 

 

 

 

 

한글 보존하는 unzip 하기

 

unzip -O cp-949 <file.zip> -d <저장할 위치>

unzip -O cp-949 <file.zip> -d <저장할 위치>

 

 

 

unzip -O cp-949를 먼저 실행해본다

 

대다수의 사람들은 여기서 끝날수도 있지만, 내 경우에는 아니었다. 

 

 

 

 

 

apt-get update
apt-get install unar


unar 관련 패키지를 먼저 설치한다

 

권한이 없다고 뜨면 앞에 sudo를 붙여서 'sudo apt-get update', 'sudo apt-get install unar' 를 순서대로 친다.

 

 

 

 

 

unar 패키지는 15.5mb로 다른 패키지에 비해 조금 큰 편이다. 

 

 

 

그리고 

 

unar [파일명].zip

unar [파일명].zip를 실행한다. 

 

 

 

그리고 확인해보면

 

 

한글이 깨지지 않고 보존되어 있는 것을 알 수 있다. 

 

 

unzip할 때 깨지면 unar package를 쓰자!

 

 

 


 

Reference

 

https://askubuntu.com/questions/935022/how-to-unzip-a-japanese-zip-file-and-avoid-mojibake-garbled-characters

 

How to unzip a Japanese ZIP file, and avoid mojibake/garbled characters

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Б...

askubuntu.com

 

 

반응형