From cc28f0681e62dd793117f4ec8bc5ac5e75176040 Mon Sep 17 00:00:00 2001 From: EBK21 Date: Sun, 2 Apr 2023 19:13:31 +0800 Subject: [PATCH] Use GB18030 for chinese locale to correctly map some utf8 symbols. Fixes https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/issues/2590 --- legendary/cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/legendary/cli.py b/legendary/cli.py index 79cd730..535c73a 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -40,6 +40,8 @@ logger = logging.getLogger('cli') class LegendaryCLI: def __init__(self, override_config=None, api_timeout=None): + if sys.stdout.encoding == 'gbk' : + sys.stdout.reconfigure(encoding='gb18030') self.core = LegendaryCore(override_config, timeout=api_timeout) self.logger = logging.getLogger('cli') self.logging_queue = None