[GRASS-dev] [GRASS GIS] #2120: wxgui: encoding errors

GRASS GIS trac at osgeo.org
Sun May 18 00:34:41 PDT 2014


#2120: wxgui: encoding errors
-----------------------------+----------------------------------------------
 Reporter:  mlennert         |       Owner:  grass-dev@…              
     Type:  defect           |      Status:  new                      
 Priority:  normal           |   Milestone:  6.4.4                    
Component:  wxGUI            |     Version:  svn-releasebranch64      
 Keywords:  locale encoding  |    Platform:  Unspecified              
      Cpu:  Unspecified      |  
-----------------------------+----------------------------------------------

Comment(by hcho):

 OK. I solved this issue by creating sitecustomize.py. Python's default
 encoding is 'ascii', so whenever it tries to compare a string (not u"...",
 but "...") with a translated message, which may not be ASCII, it complains
 about different encodings and throws an exception. My sitecustomize.py
 file looks like
 {{{
 import sys
 sys.setdefaultencoding("utf-8")
 }}}
 and I put it in gui/wxpython.

 I'm not sure if it's a good idea to include this file in GRASS SVN because
 it overrides and forces to use UTF-8 encoding. I don't know why the
 encoding setting in Preferences doesn't work. It seems like we cannot
 change the default encoding outside sitecustomize.py.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2120#comment:7>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list