X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/061d64dd011825261e71b924a38ebe3fd9e2e00b..0f00be4b33cdf013af6b64bfbd0e6841e7f0d574:/wxPython/src/_core_ex.py?ds=sidebyside diff --git a/wxPython/src/_core_ex.py b/wxPython/src/_core_ex.py index f19ca7ecd7..caaf2a8058 100644 --- a/wxPython/src/_core_ex.py +++ b/wxPython/src/_core_ex.py @@ -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 +import codecs 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 +del codecs #----------------------------------------------------------------------------