[Featureserver] type=OGR & encoding problem

Alexandre Dube adube at mapgears.com
Wed Aug 5 14:02:56 EDT 2009


Hi,

  I have some .tab files I'd like serve with featureserver.  Their 
encoding is iso-8859-1 and they do contain special characters such as 
French accents.  If I use type=OGR in the .cfg file to serve the data, I 
get the following error :

  An error occurred: 'utf8' codec can't decode byte 0xb0 in position 2: 
unexpected code byte

  I looked in the code source and it doesn't seem to support other 
character encodings than utf8.  Is this right ?  Or is this a known bug 
?  Any workaround ?

  If I import this file in PostGIS (with ogr2ogr + shp2pgsql (while 
specifying iso-8859-1 as character encoding)) and use type=PostGIS 
instead to link to this new imported data, I get no error, but I get 
weird characters (lots of '\' and numbers instead of my special 
character in the geojson string returned).  BUT, in the end, the special 
characters get displayed correctly in the application (OpenLayers) so 
it's ok.  This could be a good workaround, but I'd like to avoid the 
transfer of each file I have in PostGIS if possible...

  Any hint ?

  Many thanks,

-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Featureserver mailing list