wfs server and encoding

Daniel Morissette dmorissette at MAPGEARS.COM
Wed Oct 24 12:18:52 PDT 2007


Milo van der Linden wrote:
> I ran in to exactly the same problem, getting the data in UTF-8 was an
> absolute " must"  in order to get the labels to show up right in a Flash
> GIS client.
> 
> After searching the internet and contacting some technicians at MapInfo
> UK, I found that the only solution was to create a postGIS database in
> UTF-8 format; read the MapInfo data into the postGIS database with OGR
> and correcting encoding errors by hand....
> 

Err... if hacks are an option, then here is an untested hack that might 
be a bit simpler:

1- Use ogr2ogr or MITAB's tab2tab program (http://mitab.maptools.org/) 
to convert the tab dataset to .MIF/.MID

2- The TAB attributes are stored in the .MID file which is a regular 
text file. You could use the iconv command-line utility (on Linux 
anyway) to convert the encoding of attributes to UTF-8:

   iconv –from-code=ISO-8859-1 –to-code=UTF-8 mydata.mid > mydata_utf8.mid

3- Copy mydata.mif to mydata_utf8.mif

4- Edit the mydata_utf8.mif to change the Charset line to whatever 
MapInfo uses for UTF-8 (presumably "UTF-8")

5- Use ogr2ogr or tab2tab to convert mydata_utf8.mif + mydata_utf8.mid 
to TAB format.

This process can easily be scripted in a .BAT or bash file to run on 
multiple files.

Once again, I didn't test this, but I can't see why that would not work.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the MapServer-users mailing list