[GRASS-dev] [GRASS GIS] #3220: WinGRASS not recognizing accented utf-8 (nor cp1252) attribute values

GRASS GIS trac at osgeo.org
Wed Dec 7 03:30:41 PST 2016


#3220: WinGRASS not recognizing accented utf-8 (nor cp1252) attribute values
--------------------------+---------------------------------
  Reporter:  hellik       |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.2.0
 Component:  Default      |    Version:  svn-releasebranch72
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  MSWindows 8
--------------------------+---------------------------------

Comment (by hellik):

 Replying to [comment:1 martinl]:
 > Import (`v.import/v.in.ogr`) with `encoding=cp1252` will not help?

 {{{
 v.import encoding=cp1252 input=D:\temp\test_points.shp layer=test_points
 output=testimportcp1252
 WARNING: All available OGR layers will be imported into vector map
 <test_points>
 Check if OGR layer <test_points> contains polygons...
 Importing 9 features (OGR layer <test_points>)...
 -----------------------------------------------------
 Building topology for vector map <testimportcp1252 at data2>...
 Registering primitives...
 9 primitives registered
 9 vertices registered
 Building areas...
 0 areas built
 0 isles built
 Attaching islands...
 Attaching centroids...
 Number of nodes: 0
 Number of primitives: 9
 Number of points: 9
 Number of lines: 0
 Number of boundaries: 0
 Number of centroids: 0
 Number of areas: 0
 Number of isles: 0
 Input <D:\temp\test_points.shp> successfully imported without reprojection
 }}}

 {{{
 v.report map=testimportcp1252 at data2 option=coor
 cat|id|names|x|y|z
 1|1|ÄÖÅ|1.37409120951759|47.039352838731|0.0
 2||Æ|2.62326503635168|28.5515802015863|0.0
 3||Ø|44.095836087244|57.2825782187707|0.0
 4||Å,å,Æ,æ,Ø,ø|30.8545935228025|49.787535257766|0.0
 5||ø, Ø|10.1183079973563|51.0367090846001|0.0
 6||Þ|20.361533377396|52.0360481460674|0.0
 8||Ã…|15.1491119517375|60.3621017805262|0.0
 9||æ|-1.26290587954035|52.5879880709736|0.0

 Traceback (most recent call last):
   File "C:\OSGEO4~1\apps\grass\grass-7.3.svn\gui\wxpython\gu
 i_core\goutput.py", line 473, in OnCmdOutput

 self.cmdOutput.AddStyledMessage(message, type)
   File "C:\OSGEO4~1\apps\grass\grass-7.3.svn\gui\wxpython\gu
 i_core\goutput.py", line 772, in AddStyledMessage

 self.AddTextWrapped(message, wrap=None)
   File "C:\OSGEO4~1\apps\grass\grass-7.3.svn\gui\wxpython\gu
 i_core\goutput.py", line 721, in AddTextWrapped

 txt = EncodeString(txt)
   File "C:\OSGEO4~1\apps\grass\grass-7.3.svn\gui\wxpython\co
 re\gcmd.py", line 97, in EncodeString

 return string.encode(_enc)
   File "C:\OSGEO4~1\apps\Python27\lib\encodings\cp1252.py",
 line 12, in encode

 return codecs.charmap_encode(input,errors,encoding_table)
 UnicodeDecodeError
 :
 'ascii' codec can't decode byte 0xc3 in position 3: ordinal
 not in range(128)
 }}}

 it doesn't help.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3220#comment:2>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list