X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5917d04127f414f0c2cd400581cb1c47395a3479..b51abd73805c271dbba5af48db9519030702c751:/wxPython/src/gtk/_core.py?ds=inline diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index e3e8e8d163..dbe7f46a8c 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -13709,7 +13709,10 @@ if default == 'ascii': import locale import codecs try: - default = locale.getdefaultlocale()[1] + if hasattr(locale, 'getpreferredencoding'): + default = locale.getpreferredencoding() + else: + default = locale.getdefaultlocale()[1] codecs.lookup(default) except (ValueError, LookupError, TypeError): default = _sys.getdefaultencoding()