Browse Source

wxGUI: fix encoding issues (https://trac.osgeo.org/grass/changeset/67187, https://trac.osgeo.org/grass/changeset/67205, https://trac.osgeo.org/grass/changeset/67262 merged from trunk)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67323 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 years ago
parent
commit
7e400ce684
2 changed files with 3 additions and 3 deletions
  1. 1 1
      gui/wxpython/gui_core/forms.py
  2. 2 2
      lib/python/script/task.py

+ 1 - 1
gui/wxpython/gui_core/forms.py

@@ -2263,7 +2263,7 @@ class CmdPanel(wx.Panel):
                                    ignoreRequired = ignoreRequired)
         except ValueError as err:
             dlg = wx.MessageDialog(parent = self,
-                                   message = unicode(err),
+                                   message = gcmd.DecodeString(str(err)),
                                    caption = _("Error in %s") % self.task.name,
                                    style = wx.OK | wx.ICON_ERROR | wx.CENTRE)
             dlg.ShowModal()

+ 2 - 2
lib/python/script/task.py

@@ -32,7 +32,7 @@ if hasattr(etree, 'ParseError'):
 else:
     ETREE_EXCEPTIONS = (expat.ExpatError)
 
-from utils import decode
+from utils import encode, decode
 from core import *
 
 
@@ -200,7 +200,7 @@ class grassTask:
                     if not desc:
                         desc = p['description']
                     errorList.append(_("Parameter '%(name)s' (%(desc)s) is missing.") % \
-                                     {'name': p['name'], 'desc': desc})
+                                     {'name': p['name'], 'desc': encode(desc)})
 
         return errorList