From 8fbe28094a7255f88efec379d0a9d285ab946488 Mon Sep 17 00:00:00 2001 From: Teodor-Stelian Baltaretu Date: Fri, 12 Jul 2024 19:23:46 +0300 Subject: [PATCH] Changed the encoding method used and the selection of language --- Tautulli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tautulli.py b/Tautulli.py index 399bbc3b..4361b614 100755 --- a/Tautulli.py +++ b/Tautulli.py @@ -76,13 +76,13 @@ def main(): # If encoding is not returned, get the encoding if not encoding: - encoding = locale.getencoding() + encoding = locale.getpreferredencoding() # Special handling for Windows platform if sys.platform == 'win32': - # Get the user's default UI language on Windows + # Get the user's current language settings on Windows windll = ctypes.windll.kernel32 - lang_id = windll.GetUserDefaultUILanguage() + lang_id = windll.GetUserDefaultLCID() # Map Windows language ID to locale identifier language_code = locale.windows_locale.get(lang_id, '')