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

#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&gt;
GRASS GIS <http://grass.osgeo.org>

#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.4
Component: wxGUI | Version: svn-releasebranch64
Keywords: query | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * keywords: => query
  * version: 6.4.2 => svn-releasebranch64
  * milestone: 6.4.3 => 6.4.4

Comment:

(see also Ticket #1607)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1609#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>