Fix encoding selection on Windows

This commit is contained in:
Lartza
2017-10-18 22:44:37 +03:00
parent 0828643c09
commit 3cc280666e

View File

@@ -54,7 +54,10 @@ def main():
try:
locale.setlocale(locale.LC_ALL, "")
headphones.SYS_ENCODING = locale.getpreferredencoding()
if headphones.SYS_PLATFORM == 'win32':
headphones.SYS_ENCODING = sys.getdefaultencoding().upper()
else:
headphones.SYS_ENCODING = locale.getpreferredencoding()
except (locale.Error, IOError):
pass