Catch possible exception from getdefaultlocale

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2005-03-10 00:41:44 +00:00
parent 7c52903569
commit 061d64dd01
2 changed files with 8 additions and 2 deletions

View File

@ -40,7 +40,10 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
# http://www.alanwood.net/demos/charsetdiffs.html for differences
# between the common latin/roman encodings.
import locale
default = locale.getdefaultlocale()[1]
try:
default = locale.getdefaultlocale()[1]
except ValueError:
default = "iso8859-1"
if default:
wx.SetDefaultPyEncoding(default)
del default

View File

@ -11216,7 +11216,10 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
# http://www.alanwood.net/demos/charsetdiffs.html for differences
# between the common latin/roman encodings.
import locale
default = locale.getdefaultlocale()[1]
try:
default = locale.getdefaultlocale()[1]
except ValueError:
default = "iso8859-1"
if default:
wx.SetDefaultPyEncoding(default)
del default