[GRASS-dev] [GRASS GIS] #2617: wxgui Raster query redirect to console UnicodeDecodeError

GRASS GIS trac at osgeo.org
Tue Mar 10 23:43:49 PDT 2015


#2617: wxgui Raster query redirect to console UnicodeDecodeError
-----------------------------+----------------------------------------------
 Reporter:  marisn           |       Owner:  grass-dev@…              
     Type:  defect           |      Status:  new                      
 Priority:  normal           |   Milestone:  7.0.1                    
Component:  wxGUI            |     Version:  svn-trunk                
 Keywords:  query, encoding  |    Platform:  MSWindows Vista          
      Cpu:  Unspecified      |  
-----------------------------+----------------------------------------------

Comment(by marisn):

 Just dropping a note here as it needs further investigation:
 https://docs.python.org/2/library/gettext.html#gettext-vs-lgettext

   In Python 2.4 the lgettext() family of functions were introduced. The
 intention of these functions is to provide an alternative which is more
 compliant with the current implementation of GNU gettext. Unlike
 '''gettext(), which returns strings encoded with the same codeset used in
 the translation file''', lgettext() will return strings encoded with the
 preferred system encoding, as returned by locale.getpreferredencoding().
 Also notice that Python 2.4 introduces new functions to explicitly choose
 the codeset used in translated strings. If a codeset is explicitly set,
 even lgettext() will return translated strings in the requested codeset,
 as would be expected in the GNU gettext implementation.

 Note on "same codeset" explains where the UTF-8 strings are coming from
 and why it differs from C implementation of gettext.


 In the aforementioned document is also another one interesting remark:
 https://docs.python.org/2/library/gettext.html#the-gnutranslations-class

   Note that the Unicode version of the methods (i.e. ugettext() and
 ungettext()) are the recommended interface to use for internationalized
 Python programs.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2617#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list