Skip to content

Instantly share code, notes, and snippets.

@myjian
Last active December 27, 2017 00:23
Show Gist options
  • Save myjian/d3641eba544b2a0739dced4c51570785 to your computer and use it in GitHub Desktop.
Save myjian/d3641eba544b2a0739dced4c51570785 to your computer and use it in GitHub Desktop.
Extract Japanese zip file
import zipfile
import shutil
zipname = "brs.zip"
with zipfile.ZipFile(zipname) as z:
for fileinfo in z.infolist():
with z.open(fileinfo) as f:
unicode_filename = fileinfo.filename.decode("shift_jis").encode("utf-8")
with open(unicode_filename, "wb") as outputfile:
shutil.copyfileobj(f, outputfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment