still "ascii"
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33025
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
# different on different platforms. For example, please see
# http://www.alanwood.net/demos/charsetdiffs.html for differences
# between the common latin/roman encodings.
# different on different platforms. For example, please see
# http://www.alanwood.net/demos/charsetdiffs.html for differences
# between the common latin/roman encodings.
-import locale
-import codecs
-try:
- default = locale.getdefaultlocale()[1]
- codecs.lookup(default)
-except (ValueError, LookupError):
- default = _sys.getdefaultencoding()
+
+default = _sys.getdefaultencoding()
+if default == 'ascii':
+ import locale
+ import codecs
+ try:
+ default = locale.getdefaultlocale()[1]
+ codecs.lookup(default)
+ except (ValueError, LookupError):
+ default = _sys.getdefaultencoding()
+ del locale
+ del codecs
if default:
wx.SetDefaultPyEncoding(default)
del default
if default:
wx.SetDefaultPyEncoding(default)
del default
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------