Opened 12 years ago

Last modified 7 years ago

#1607 new defect

WXGUI regression - attribute query fails to display text attribute values

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


Steps to reproduce:

  • add a vector map
  • use attribute query tool to get object attributes
  • observe an error instead of attribute value "Unable to decode value. Set encoding in GUI preferences ('Attributes')."
  • repeat the same steps in 6.4.0 and observe correct attribute data values

Both wxgui instances have no "attribute data encoding" set.

Attachments (1) (1.6 KB ) - added by marisn 11 years ago.
Shapefile with unknown encoding

Download all attachments as: .zip

Change History (7)

comment:1 by neteler, 11 years ago

Do you have a sample map to test?

by marisn, 11 years ago

Attachment: added

Shapefile with unknown encoding

in reply to:  1 comment:2 by marisn, 11 years ago

Replying to neteler:

Do you have a sample map to test?

Here You go. Just create a location and import attached file. Compare output of 6.4.0 and 6.4.x current on the same file.

The idea of setting encoding in a GUI preferences is flawed by design. I routinely deal with datasets in different encodings (map1 - utf-8; map2 - ISO-8859-13; etc.). Still this is a change that needs to be done in GRASS 7 to allow specifying encoding for each vector dataset/layer(?) separately.

comment:3 by neteler, 11 years ago

Keywords: query added

Yes, confirmed.

OGR can decipher it:

ogrinfo grass_encoding.shp grass_encoding
INFO: Open of `grass_encoding.shp'
      using driver `ESRI Shapefile' successful.

Layer name: grass_encoding
Geometry: Point
Feature Count: 2
Extent: (490813.154373, 280495.272002) - (516942.353107, 284572.168258)
Layer SRS WKT:
id: Integer (10.0)
nosaukums: String (80.0)
  id (Integer) = (null)
  nosaukums (String) = âðòï
  POINT (490813.154373089957517 284572.168258102843538)

  id (Integer) = (null)
  nosaukums (String) = çèþì
  POINT (516942.35310710943304 280495.272001731034834)

while GRASS' wxGUI query tool cannot giving the indicated error.

Also the Tcl/TK form fails: "nosaukums : âðòï "

in reply to:  3 comment:4 by marisn, 11 years ago

Replying to neteler:

Yes, confirmed.

while GRASS' wxGUI query tool cannot giving the indicated error.

Also the Tcl/TK form fails: "nosaukums : âðòï "

Well - OGR just passes raw string trough. It's not correct, still for a latin letters based text it will work just fine. I made a bad example, as I should be using example "Rîga", which is incorrect, still for anyone in Latvia it would be clear that it should be "Rīga". GRASS 6.4.0 was just passing-through any attribute data and thus ignored any coding issues. Changes in 6.4.x introduced (broken by design) recoding of values and thus instead of just seeing broken string, that might be meaningful enough to be fine, now it displays error message. Saying "just set correct encoding in blahblah" for non-technical users equals "no attributes for You!". Why it's broken? Try to set encoding in preferences to datasets encoding: "CP-1257"

Settings applied to current session but not saved                               
Traceback (most recent call last):
  File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/lmgr/", line 1355, in

selection = selection)
  File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/dbmgr/", line 641, in __init__

  File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/dbmgr/", line 688, in

self.mapDBInfo, layer)
  File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/dbmgr/", line 93, in __init__

keyColumn = self.LoadData(layer)
  File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/dbmgr/", line 246, in LoadData

self.AddDataRow(i, record, columns, keyId)
  File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/dbmgr/", line 295, in AddDataRow

  File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/dbmgr/", line 35, in unicodeValue

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

comment:5 by neteler, 10 years ago


(see also Ticket #1609)

comment:6 by neteler, 7 years ago

Note: See TracTickets for help on using tickets.