diff --git a/aeneas/diagnostics.py b/aeneas/diagnostics.py index 7d9e98a1..6f4e291f 100644 --- a/aeneas/diagnostics.py +++ b/aeneas/diagnostics.py @@ -56,9 +56,9 @@ def check_shell_encoding(cls): """ is_in_utf8 = True is_out_utf8 = True - if sys.stdin.encoding not in ["UTF-8", "UTF8"]: + if sys.stdin.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: is_in_utf8 = False - if sys.stdout.encoding not in ["UTF-8", "UTF8"]: + if sys.stdout.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: is_out_utf8 = False if (is_in_utf8) and (is_out_utf8): gf.print_success(u"shell encoding OK") diff --git a/aeneas/tools/abstract_cli_program.py b/aeneas/tools/abstract_cli_program.py index be5bb2fa..b5b9fadd 100644 --- a/aeneas/tools/abstract_cli_program.py +++ b/aeneas/tools/abstract_cli_program.py @@ -295,10 +295,10 @@ def run(self, arguments, show_help=True): if self.use_sys: # check that sys.stdin.encoding and sys.stdout.encoding are set to utf-8 if not gf.FROZEN: - if sys.stdin.encoding not in ["UTF-8", "UTF8"]: + if sys.stdin.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: self.print_warning(u"The default input encoding is not UTF-8.") self.print_warning(u"You might want to set 'PYTHONIOENCODING=UTF-8' in your shell.") - if sys.stdout.encoding not in ["UTF-8", "UTF8"]: + if sys.stdout.encoding not in ["UTF-8", "UTF8", "utf-8", "utf8"]: self.print_warning(u"The default output encoding is not UTF-8.") self.print_warning(u"You might want to set 'PYTHONIOENCODING=UTF-8' in your shell.") # decode using sys.stdin.encoding