VirtualMailManager/__init__.py
changeset 152 3dbee02711cd
parent 141 ecd6a379e523
child 162 0ac9ef587769
--- a/VirtualMailManager/__init__.py	Wed Sep 09 07:13:20 2009 +0000
+++ b/VirtualMailManager/__init__.py	Thu Sep 10 01:42:26 2009 +0000
@@ -11,9 +11,12 @@
 from constants.VERSION import *
 import constants.ERROR as ERR
 
-# Set all of the locales according to the current environment variables
-# and get the character encoding.
-locale.setlocale(locale.LC_ALL, '')
+# Try to set all of the locales according to the current
+# environment variables and get the character encoding.
+try:
+    locale.setlocale(locale.LC_ALL, '')
+except locale.Error:
+    locale.setlocale(locale.LC_ALL, 'C')
 ENCODING = locale.nl_langinfo(locale.CODESET)
 
 def w_std(*args):