feat(config): 增加 allow_unicode 和 encoding 参数以支持 Unicode 字符
This commit is contained in:
parent
bae7b2fc19
commit
ab343c6ca7
|
|
@ -87,7 +87,10 @@ class ConfigManager:
|
|||
# 直接保存所有字段,不排除任何内容
|
||||
config_dict = self._config.model_dump()
|
||||
with open(self.config_file, 'w', encoding='utf-8') as f:
|
||||
yaml.dump(config_dict, f, default_flow_style=False)
|
||||
yaml.dump(config_dict, f,
|
||||
default_flow_style=False,
|
||||
allow_unicode=True, # 新增:允许Unicode字符
|
||||
encoding='utf-8') # 确保编码
|
||||
except Exception as e:
|
||||
print(f"保存配置失败: {e}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue