fix: force UTF-8 encoding for WeChat draft/get response

WeChat API returns Content-Type without charset, causing requests to
default to ISO-8859-1. Chinese content was decoded as mojibake.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
wangzhuc 2026-03-31 15:59:55 +08:00
parent 73a67fffc7
commit 7f0aff1738

View file

@ -79,6 +79,7 @@ def get_draft(access_token: str, media_id: str) -> str:
params={"access_token": access_token},
json={"media_id": media_id},
)
resp.encoding = "utf-8"
data = resp.json()
errcode = data.get("errcode", 0)