From 3aabb240bef95e239f39e9c2689f09bdc8c6fc29 Mon Sep 17 00:00:00 2001 From: Teodor-Stelian Baltaretu Date: Sat, 13 Jul 2024 02:21:14 +0300 Subject: [PATCH] Removed hardcoded encoding in Windows handling --- Tautulli.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Tautulli.py b/Tautulli.py index 4361b614..200cd39d 100755 --- a/Tautulli.py +++ b/Tautulli.py @@ -74,10 +74,6 @@ def main(): # Attempt to get the system's locale settings language_code, encoding = locale.getlocale() - # If encoding is not returned, get the encoding - if not encoding: - encoding = locale.getpreferredencoding() - # Special handling for Windows platform if sys.platform == 'win32': # Get the user's current language settings on Windows @@ -87,8 +83,8 @@ def main(): # Map Windows language ID to locale identifier language_code = locale.windows_locale.get(lang_id, '') - # Set encoding to Windows default encoding - encoding = "cp1252" + # Get the preferred encoding + encoding = locale.getpreferredencoding() # Assign values to application-specific variable plexpy.SYS_LANGUAGE = language_code