修复Markdown文集zip压缩包导入后文档乱码的问题

This commit is contained in:
zmister 2021-10-16 15:07:36 +08:00
parent df7f4814ff
commit 5034ca74f2

View File

@ -41,7 +41,7 @@ class ImportZipProject():
for root, dirs, files in os.walk(self.temp_dir):
for dir in dirs:
try:
new_dir = dir.encode('cp437').decode('gbk')
new_dir = dir.encode('cp437').decode('utf-8')
except:
new_dir = dir.encode('utf-8').decode('utf-8')
# print(new_dir)
@ -49,7 +49,7 @@ class ImportZipProject():
for file in files:
try:
new_file = file.encode('cp437').decode('gbk')
new_file = file.encode('cp437').decode('utf-8')
except:
new_file = file.encode('utf-8').decode('utf-8')
# print(root, new_file)