diff --git a/thefuck/system/win32.py b/thefuck/system/win32.py index b09778e1..a8b6c0a4 100644 --- a/thefuck/system/win32.py +++ b/thefuck/system/win32.py @@ -1,3 +1,4 @@ +import os import sys import msvcrt import win_unicode_console @@ -22,4 +23,5 @@ def get_key(): if ch == b'P': return const.KEY_DOWN - return ch.decode(sys.stdout.encoding) \ No newline at end of file + encoding = sys.stdout.encoding or os.environ.get('PYTHONIOENCODING', 'utf-8') + return ch.decode(encoding)