From 953f8fa943e3f670112fd884793a7a5fb0aadff3 Mon Sep 17 00:00:00 2001 From: Tianworld <3580442280@qq.com> Date: Sun, 12 Apr 2026 23:28:21 +0800 Subject: [PATCH] fix(scripts): read gateway_voice_mode.json as UTF-8 json.loads after read_text() used locale default on Windows; UTF-8 state file could mis-parse. Made-with: Cursor --- scripts/discord-voice-doctor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/discord-voice-doctor.py b/scripts/discord-voice-doctor.py index 6fc3f7b15..932ab519c 100755 --- a/scripts/discord-voice-doctor.py +++ b/scripts/discord-voice-doctor.py @@ -265,7 +265,7 @@ def check_config(groq_key, eleven_key): if voice_mode_path.exists(): try: import json - modes = json.loads(voice_mode_path.read_text()) + modes = json.loads(voice_mode_path.read_text(encoding="utf-8")) off_count = sum(1 for v in modes.values() if v == "off") all_count = sum(1 for v in modes.values() if v == "all") check("Voice mode state", True, f"{all_count} on, {off_count} off, {len(modes)} total")