1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-15 20:27:22 +08:00

Fix: fix UTF-8 encode on non-UTF-8 systems

This commit is contained in:
whoamikyo
2020-06-23 08:29:22 -03:00
parent 270a717d9e
commit cd968e9c40

View File

@@ -1,5 +1,6 @@
import codecs
import os
import sys
from gooey import Gooey, GooeyParser
@@ -9,6 +10,11 @@ from module.config.dictionary import dic_true_eng_to_eng, dic_eng_to_true_eng
from module.config.update import get_config
from module.logger import pyw_name
if sys.stdout.encoding != 'UTF-8':
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
if sys.stderr.encoding != 'UTF-8':
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
@Gooey(
optional_cols=2,