update app_doc/import_utils.py.

在windows下部署时文集压缩包文件名为中文乱码修复错误问题
This commit is contained in:
老呆瓜 2022-03-13 14:01:27 +00:00 committed by Gitee
parent 87f0d359cc
commit b4fbc6da1f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

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('utf-8')
new_dir = dir.encode('cp437').decode('gbk')
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('utf-8')
new_file = file.encode('cp437').decode('gbk')
except:
new_file = file.encode('utf-8').decode('utf-8')
# print(root, new_file)