fix(bug): bug fix

This commit is contained in:
Timebomb2018
2026-03-19 17:54:32 +08:00
parent 7056865726
commit 6105d46198
3 changed files with 5 additions and 10 deletions

View File

@@ -713,7 +713,8 @@ class MultimodalService:
# 1. 自动检测文件编码
detect = chardet.detect(file_content)
encoding = detect.get("encoding", "utf-8").lower()
encoding = detect.get("encoding") or "utf-8"
encoding = encoding.lower()
# 2. 兼容常见中文编码
compatible_encodings = ["utf-8", "gbk", "gb18030", "gb2312", "ascii", "latin-1"]