From 7c7c33c7182badb0e8029932cfc063665f9c41f4 Mon Sep 17 00:00:00 2001 From: Sci-Twi <123055116+Sci-Twi@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:16:59 +0800 Subject: [PATCH] exporting utf-8 csv files --- common/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils.py b/common/utils.py index 395e075..3f7cbab 100644 --- a/common/utils.py +++ b/common/utils.py @@ -248,11 +248,11 @@ def save_to_file(path, data): :return: 保存成功与否 """ 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) return True except TypeError: - with open(path, 'wb') as file: + with open(path, 'wb', encoding='utf-8') as file: file.write(data) return True except Exception as e: