问题描述:
在使用zipfile读取文件的时候,解压出来的文件名称是乱码,如:‘╡┌╥╗╒┬_╒╨▒Ω╣½╕µ.docx’
问题产生原因:
参考资料
There is no official file name encoding for ZIP files. If you have unicode file names, you must convert them to byte strings in your desired encoding before passing them to write(). WinZip interprets all file names as encoded in CP437, also known as DOS Latin.
ZIP文件没有官方的文件名编码。如果您有unicode文件名,那么在将它们传递给write()之前,必须将它们转换成所需编码的字节字符串。WinZip将所有文件名解释为用CP437(也称为DOS拉丁文)编码的。
解决方法:
直接打开zipfile.py,搜索代码中的cp437替换为gbk