diff --git a/backend/config.py b/backend/config.py index 56ca509d..69e9f4ad 100644 --- a/backend/config.py +++ b/backend/config.py @@ -23,7 +23,7 @@ MODE_CONFIG_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'settings.ini') if not os.path.exists(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'settings.ini')): # 如果没有配置文件,默认使用中文 - with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'settings.ini'), mode='w', encoding='uft-8') as f: + with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'settings.ini'), mode='w', encoding='utf-8') as f: f.write('[DEFAULT]\n') f.write('Interface = 简体中文\n') f.write('Language = ch\n') diff --git a/gui.py b/gui.py index 8e007d9d..7879e3fc 100644 --- a/gui.py +++ b/gui.py @@ -384,7 +384,7 @@ def _interface_event_handler(self, event, values): @staticmethod def set_config(config_file, interface, language_code, mode): # 写入配置文件 - with open(config_file, mode='w', encoding='uft-8') as f: + with open(config_file, mode='w', encoding='utf-8') as f: f.write('[DEFAULT]\n') f.write(f'Interface = {interface}\n') f.write(f'Language = {language_code}\n')