I use python's zipfile module to extract a .zip archive (Let's take this file at http://img.dafont.com/dl/?f=akvaleir for example.)
我使用python的zipfile模塊來提取.zip存檔(例如,讓我們在http://img.dafont.com/dl/?f=akvaleir上獲取此文件。)
f = zipfile.ZipFile('akvaleir.zip', 'r')
for fileinfo in f.infolist():
print fileinfo.filename
f.extract(fileinfo, '.')
Its output:
它的輸出:
Akval�ir_Normal_v2007.ttf
Akval�ir, La police - The Font - Fr - En.pdf
Both files are unaccessable after extraction because there are invalid encoded characters in their filenames. The problem is zipfile module doesn't have an option to specify output filenames.
提取后兩個文件都無法訪問,因為文件名中包含無效的編碼字符。問題是zipfile模塊沒有指定輸出文件名的選項。
However, "unzip akvaleir.zip" escapes the filename well:
但是,“解壓縮akvaleir.zip”很好地逃