Opened 13 years ago

Last modified 9 years ago

#1609 new defect

WXGUI doesn't offer a supported encodings for "Attribute data encoding" setting

Reported by: marisn Owned by: grass-dev@…
Priority: normal Milestone: 6.4.6
Component: wxGUI Version: svn-releasebranch64
Keywords: query Cc:
CPU: Unspecified Platform: Unspecified

Description

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

Change History (2)

comment:1 by neteler, 11 years ago

Keywords: query added
Milestone: 6.4.36.4.4
Version: 6.4.2svn-releasebranch64

(see also Ticket #1607)

comment:2 by neteler, 9 years ago

Milestone: 6.4.46.4.6
Note: See TracTickets for help on using tickets.