]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_core_ex.py
Wait() should now return correct exit code even if thread state was EXITED (replaces...
[wxWidgets.git] / wxPython / src / _core_ex.py
index f19ca7ecd7b1c3e64122a5c09b9b878ee036e70c..caaf2a8058f8c5919d2d8b5f96fa6bb596b1bf15 100644 (file)
@@ -40,14 +40,17 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
 # http://www.alanwood.net/demos/charsetdiffs.html for differences
 # between the common latin/roman encodings.
 import locale
 # http://www.alanwood.net/demos/charsetdiffs.html for differences
 # between the common latin/roman encodings.
 import locale
+import codecs
 try:
     default = locale.getdefaultlocale()[1]
 try:
     default = locale.getdefaultlocale()[1]
-except ValueError:
-    default = "iso8859-1"
+    codecs.lookup(default)
+except (ValueError, LookupError):
+    default = _sys.getdefaultencoding()
 if default:
     wx.SetDefaultPyEncoding(default)
 del default
 del locale
 if default:
     wx.SetDefaultPyEncoding(default)
 del default
 del locale
+del codecs
 
 #----------------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------------