Handle invalid UTF-8 with replacement decoding

This commit is contained in:
jxxghp
2026-06-21 09:56:34 +08:00
parent 99e369aaa4
commit 68f18db374
29 changed files with 139 additions and 121 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ class Rtorrent:
if isinstance(content, bytes):
# 检查是否为磁力链接(bytes形式)
if content.startswith(b"magnet:"):
content = content.decode("utf-8", errors="ignore")
content = content.decode("utf-8", errors="replace")
else:
# 种子文件内容,使用load.raw
raw = xmlrpc.client.Binary(content)