diff --git a/docutranslate/glossary/glossary.py b/docutranslate/glossary/glossary.py index 1669b94..5e675c8 100644 --- a/docutranslate/glossary/glossary.py +++ b/docutranslate/glossary/glossary.py @@ -35,4 +35,6 @@ class Glossary: writer = csv.writer(content, delimiter=delimiter) writer.writerow(['src', 'dst']) 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) diff --git a/更新日志.txt b/更新日志.txt index 6c411e1..aaaddec 100644 --- a/更新日志.txt +++ b/更新日志.txt @@ -5,6 +5,7 @@ v1.4.0版 2025.9.4 - 更全面的异常处理机制和更少出现的漏翻 优化 - 优化提示词 +- 生成术语表使用UTF8-BOM编码 修复 - 修复API文档错误示例 接口变化