]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_core_ex.py
Include wx/filedlg.h when not WX_PRECOMP.
[wxWidgets.git] / wxPython / src / _core_ex.py
index bb3658d73ce2638bd120797754cdcbde44675b61..bd9ecf759eb388b2db78e59514b4e478d716bf42 100644 (file)
@@ -67,7 +67,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()