X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=bin%2Funzip.py;h=57af7b1d5a277eec95eb5b9e1e6265c57c98750d;hp=e88e5265a5504d69949ec375d348845424f33e1d;hb=HEAD;hpb=3fdf2f7baaa3a67880de95948d6ee76bc698fbc9 diff --git a/bin/unzip.py b/bin/unzip.py index e88e526..57af7b1 100755 --- a/bin/unzip.py +++ b/bin/unzip.py @@ -1,7 +1,7 @@ #! /usr/bin/env python3 """Unzip with encoded filenames - Written by Oleg Broytman. Copyright (C) 2009-2023 PhiloSoft Design. + Written by Oleg Broytman. Copyright (C) 2009-2024 PhiloSoft Design. """ import sys, os, time @@ -27,8 +27,7 @@ out = '.' for zinfo in zf.infolist(): path = zinfo.filename if isinstance(path, bytes): - path = path.decode('cp866') - recoded_path = path.encode(default_encoding) + recoded_path = path.decode('cp866').encode(default_encoding) else: recoded_path = path print(recoded_path)