1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-04 09:31:12 +03:00

Locale: Use LC_CTYPE as source of language for setting UTF-8 encoding

See #725 - LC_ALL is actually invalid here, but is allowed in Python
3.7.9, but not in later 3.8.x.
This commit is contained in:
Athanasius 2020-10-01 11:00:11 +01:00
parent 25ee03a1b6
commit 3063b237b6

View File

@ -1108,8 +1108,8 @@ sys.path: {sys.path}'''
locale.setlocale(locale.LC_ALL, '')
log_locale('After LC_ALL defaults set')
# Now find out the current locale, mostly the language
locale_startup = locale.getlocale(locale.LC_ALL)
logger.debug(f'Locale LC_ALL: {locale_startup}')
locale_startup = locale.getlocale(locale.LC_CTYPE)
logger.debug(f'Locale LC_CTYPE: {locale_startup}')
# Now set that same language, but utf8 encoding (it was probably cp1252
# or equivalent for other languages).
# UTF-8, not utf8: <https://en.wikipedia.org/wiki/UTF-8#Naming>