导出术语表使用utf8-bom编码

This commit is contained in:
xunbu
2025-09-04 19:57:44 +08:00
parent a3012a9af0
commit 551344e329
2 changed files with 4 additions and 1 deletions

View File

@@ -35,4 +35,6 @@ class Glossary:
writer = csv.writer(content, delimiter=delimiter) writer = csv.writer(content, delimiter=delimiter)
writer.writerow(['src', 'dst']) writer.writerow(['src', 'dst'])
writer.writerows(csv_rows) writer.writerows(csv_rows)
return Document.from_bytes(content=content.getvalue().encode("utf-8"), suffix=".csv", stem=stem) bom = '\ufeff'
content_with_bom = bom + content.getvalue()
return Document.from_bytes(content=content_with_bom.encode("utf-8"), suffix=".csv", stem=stem)

View File

@@ -5,6 +5,7 @@ v1.4.0版 2025.9.4
- 更全面的异常处理机制和更少出现的漏翻 - 更全面的异常处理机制和更少出现的漏翻
优化 优化
- 优化提示词 - 优化提示词
- 生成术语表使用UTF8-BOM编码
修复 修复
- 修复API文档错误示例 - 修复API文档错误示例
接口变化 接口变化