VMM: Show a warning when a unsupported locale setting was detected. v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Sat, 05 Nov 2011 19:04:07 +0000
branchv0.6.x
changeset 457 2019aa415dcd
parent 456 7847f949d0a2
child 458 4ff0fa3ba0fa
VMM: Show a warning when a unsupported locale setting was detected.
VirtualMailManager/__init__.py
--- a/VirtualMailManager/__init__.py	Sat Nov 05 16:41:19 2011 +0000
+++ b/VirtualMailManager/__init__.py	Sat Nov 05 19:04:07 2011 +0000
@@ -10,6 +10,7 @@
 
 import gettext
 import locale
+import sys
 
 from VirtualMailManager.constants import __author__, __date__, __version__
 
@@ -26,6 +27,8 @@
 try:
     locale.setlocale(locale.LC_ALL, '')
 except locale.Error:
+    sys.stderr.write('warning: unsupported locale setting - '
+                     'that may cause encoding problems.\n\n')
     locale.setlocale(locale.LC_ALL, 'C')
 ENCODING = locale.nl_langinfo(locale.CODESET)