From f02896c839358d3817f368877c0e6b0335ce1c83 Mon Sep 17 00:00:00 2001 From: ayanamist Date: Thu, 12 Mar 2026 19:19:43 +0800 Subject: [PATCH] Fix #33 Reconfigure stdout and stderr to use UTF-8 encoding to fix Windows GBK pipe issue. --- src/faster_whisper_transwithai_chickenrice/infer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/faster_whisper_transwithai_chickenrice/infer.py b/src/faster_whisper_transwithai_chickenrice/infer.py index 0eaebc3..9f9e9ae 100644 --- a/src/faster_whisper_transwithai_chickenrice/infer.py +++ b/src/faster_whisper_transwithai_chickenrice/infer.py @@ -1183,6 +1183,9 @@ def main(): args = parse_arguments() + # fix windows gbk pipe issue + sys.stdout.reconfigure(encoding="utf-8") + sys.stderr.reconfigure(encoding="utf-8") # Display open-source notice print("=" * 70) print("⚠️ 重要声明 / IMPORTANT NOTICE")