Merge pull request #411 from Sci-Twi/patch-1

exporting utf-8 csv files
This commit is contained in:
Jing Ling
2026-05-11 22:02:22 +08:00
committed by GitHub
+2 -2
View File
@@ -248,11 +248,11 @@ def save_to_file(path, data):
:return: 保存成功与否 :return: 保存成功与否
""" """
try: try:
with open(path, 'w', errors='ignore', newline='') as file: with open(path, 'w', errors='ignore', newline='', encoding='utf-8') as file:
file.write(data) file.write(data)
return True return True
except TypeError: except TypeError:
with open(path, 'wb') as file: with open(path, 'wb', encoding='utf-8') as file:
file.write(data) file.write(data)
return True return True
except Exception as e: except Exception as e: