[GRASS-dev] [GRASS GIS] #1609: WXGUI doesn't offer a supported encodings for "Attribute data encoding" setting

GRASS GIS trac at osgeo.org
Sun Mar 11 06:54:38 EDT 2012


#1609: WXGUI doesn't offer a supported encodings for "Attribute data encoding"
setting
-------------------------+--------------------------------------------------
 Reporter:  marisn       |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  6.4.3                    
Component:  wxGUI        |     Version:  6.4.2                    
 Keywords:               |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------
 If user needs to set an encoding for attribute data, he isn't given a list
 of supported encodings. User entered encoding is not checked before use.

 Example: after setting encoding to "CP-1257" (a valid encoding for Baltic
 languages in MS-Windows), WXGUI preferences dialog accepts it, still later
 attribute query fails with:

 {{{
 Traceback (most recent call last):
   File "C:\Program Files\GRASS
 6.4.2\etc\wxpython\gui_modules\mapdisp_window.py", line
 1017, in MouseActions

 self.OnLeftUp(event)
   File "C:\Program Files\GRASS
 6.4.2\etc\wxpython\gui_modules\mapdisp_window.py", line
 1207, in OnLeftUp

 self.parent.QueryVector(self.mouse['begin'][0],
 self.mouse['begin'][1])
   File "C:\Program Files\GRASS
 6.4.2\etc\wxpython\gui_modules\mapdisp.py", line 1383, in
 QueryVector

 action = mode)
   File "C:\Program Files\GRASS
 6.4.2\etc\wxpython\gui_modules\dbm_dialogs.py", line 102, in
 __init__

 self.UpdateDialog(query = query, cats = cats)
   File "C:\Program Files\GRASS
 6.4.2\etc\wxpython\gui_modules\dbm_dialogs.py", line 362, in
 UpdateDialog

 query[1])
   File "C:\Program Files\GRASS
 6.4.2\etc\wxpython\gui_modules\dbm_base.py", line 112, in
 SelectByPoint

 value = unicodeValue(value)
   File "C:\Program Files\GRASS
 6.4.2\etc\wxpython\gui_modules\dbm_base.py", line 36, in
 unicodeValue

 value = unicode(value, enc)
 LookupError
 :
 unknown encoding: CP-1257
 }}}

 Solution:
  * WXGUI should use "system" encoding by default, if user hasn't set one
 in his preferences thus avoiding a need to change it for most of use cases
  * WXGUI should provide a drop-down list with all supported encodings to
 avoid ability to set a valid, still unsupported encoding

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1609>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list