ソースを参照

wxGUI: call unicode() with `errors=replace' (avoid failure)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54250 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年 前
コミット
b1beb46996
1 ファイル変更2 行追加2 行削除
  1. 2 2
      gui/wxpython/gui_core/goutput.py

+ 2 - 2
gui/wxpython/gui_core/goutput.py

@@ -631,9 +631,9 @@ class GStc(stc.StyledTextCtrl):
             except UnicodeDecodeError:
                 enc = UserSettings.Get(group = 'atm', key = 'encoding', subkey = 'value')
                 if enc:
-                    txt = unicode(txt, enc)
+                    txt = unicode(txt, enc, errors = 'replace')
                 elif 'GRASS_DB_ENCODING' in os.environ:
-                    txt = unicode(txt, os.environ['GRASS_DB_ENCODING'])
+                    txt = unicode(txt, os.environ['GRASS_DB_ENCODING'], errors = 'replace')
                 else:
                     txt = EncodeString(txt)