]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/_core.py
bitwise vs. logical operator
[wxWidgets.git] / wxPython / src / msw / _core.py
index e5794e1ae436a431d9e171cb407f51ce3df906b3..f9cf4a84381c7793fb7439f54b1a17f70b03f651 100644 (file)
@@ -13713,7 +13713,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()