快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

Fedora20中解决zip解压文件时中文文件名的乱码问题[已解决]-创新互联

该方法的原文地址: http://wangqige.com/the-solution-of-unzip-files-which-zip-under-windows/(链接已失效)

成都创新互联公司成立于2013年,先为绿园等服务建站,绿园等地企业,进行企业商务咨询服务。为绿园企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

解决方法:保存如下Python代码到文件unzip.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()

使用方法如下:

python unzip.py *.zip
分享题目:Fedora20中解决zip解压文件时中文文件名的乱码问题[已解决]-创新互联
当前URL:http://6mz.cn/article/hjods.html

其他资讯