Last active
December 27, 2017 00:23
-
-
Save myjian/d3641eba544b2a0739dced4c51570785 to your computer and use it in GitHub Desktop.
Extract Japanese zip file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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