diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index 803fd5691..bcf489fc5 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -24,6 +24,11 @@ from aqt.utils import locale_dir assert anki.buildinfo.buildhash == aqt.buildinfo.buildhash +# we want to be able to print unicode debug info to console without +# fear of a traceback on systems with the console set to ASCII +sys.stdout.reconfigure(encoding="utf-8") # type: ignore +sys.stderr.reconfigure(encoding="utf-8") # type: ignore + appVersion = _version appWebsite = "https://apps.ankiweb.net/" appChanges = "https://apps.ankiweb.net/docs/changes.html"