最近碰到这个问题,网上搜了一圈,都是什么unzip -O,一点用都没有,这些哥们估计是直接复制,用都没用过。
后来找了个终极方法,用python的脚本来解压,试了下,还真管用!!!
以下为python脚本的代码,新建文件jieya.py,写入以下代码:
=============================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import zipfile
print "Processing File " + sys.argv[1]
file=zipfile.ZipFile(sys.argv[1],"r");
for name in file.namelist():
utf8name=name.decode('gbk')
print "Extracting " + utf8name
pathname = os.path.dirname(utf8name)
if not os.path.exists(pathname) and pathname!= "":
os.makedirs(pathname)
data = file.read(name)
if not os.path.exists(utf8name):
fo = open(utf8name, "w")
fo.write(data)
fo.close
file.close()
=============================================================
然后zip文件跟jieya.py放在同一级目录,运行命令python jieya.py file.zip,哦了!