Skip to content

Instantly share code, notes, and snippets.

@stypr
Created March 17, 2020 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stypr/23dd2a0bffcff42ce298719e968a6ea5 to your computer and use it in GitHub Desktop.
Save stypr/23dd2a0bffcff42ce298719e968a6ea5 to your computer and use it in GitHub Desktop.
Unzip with different encoding
#!/usr/bin/python
#Nothing on stackoverflow works!
import zipfile
import sys
zip = zipfile.ZipFile('FILENAME', 'r')
zipinfo = zip.infolist()
for _file in zipinfo:
_file.filename = bytes(_file.filename).decode('cp949')
zip.extract(_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment