Merge pull request #3037 from Lartza/fix-win-encoding

Fix SYS_ENCODING selection on Windows
This commit is contained in:
AdeHub
2017-10-22 09:49:48 +13:00
committed by GitHub

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