Unzip all Zips in Python folder (recursive) garbled characters (Qiita first post)

First Qiita post I usually do data visualization with R or Python in Tableau.

When you want to unzip Zip with Python but the characters are garbled

import

from zipfile import ZipFile

Decompress without garbled characters

for file in zip_files:
    with ZipFile(file) as zip:
       for info in zip.infolist():
           info.filename = info.filename.encode('cp437').decode('cp932')
           zip.extract(info)  

It seems that some people can do it with unicode. You can now unzip it.

Qiita first post

I've been helped too much for years, so I hope I can update my know-how little by little. I'll do my best

Recommended Posts

Unzip all Zips in Python folder (recursive) garbled characters (Qiita first post)
About __all__ in python
Eliminate garbled Japanese characters in Python library matplotlib and NetworkX
Post to Slack in Python