solution One, using Pyton to deal with
1.VI uzip File
2. Copy the content (Python)
#!/usr/bin/env python#-*-coding:utf-8-*-#uzip.py ImportOSImportSYSImportZipFilePrint "processing File"+ sys.argv[1] File=zipfile. ZipFile (Sys.argv[1],"R"); forNameinchfile.namelist (): Utf8name=name.decode ('GBK') Print "extracting"+Utf8name Pathname=os.path.dirname (utf8name)if notOs.path.exists (Pathname) andpathname!="": Os.makedirs (pathname) Data=file.read (name)if notos.path.exists (utf8name): Fo= Open (Utf8name,"W") fo.write (data) fo.closefile.close ()
3.chmod +x Uzip
4../uzip Xxxx.zip
Method 2, extract by Unzip line command, specify character set (recommended)
Unzip-o CP936 Xxx.zip (with GBK, GB18030 can also)
Interestingly, there is no explanation for this option in Unzip's manual, and Unzip–help has a simple one-line explanation for this parameter.
Method 3, in the environment variable, specify the unzip parameter, always display and decompress the file in the specified character set
Add 2 rows to the/etc/environment
unzip= "-O Cp936″
zipinfo= "-O Cp936″
Method 4, unpack the zip package jar using the Java Jar command
Jar XVF File.name
Linux zip file after extracting garbled solution