Browse Source

wxGUI/dbmgr: don't fail on unknown encoding

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54245 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 năm trước cách đây
mục cha
commit
30bf33aeea
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 8 2
      gui/wxpython/dbmgr/vinfo.py

+ 8 - 2
gui/wxpython/dbmgr/vinfo.py

@@ -32,9 +32,15 @@ def unicodeValue(value):
     
     enc = UserSettings.Get(group = 'atm', key = 'encoding', subkey = 'value')
     if enc:
-        value = unicode(value, enc)
+        try:
+            value = unicode(value, enc)
+        except LookupError, e:
+            value = e
     elif 'GRASS_DB_ENCODING' in os.environ:
-        value = unicode(value, os.environ['GRASS_DB_ENCODING'])
+        try:
+            value = unicode(value, os.environ['GRASS_DB_ENCODING'])
+        except LookupError, e:
+            value = e
     else:
         try:
             value = unicode(value, 'ascii')