[mapserver-users] GetfeatureInfo-Request in an UTF-8 environment with shapfile in cp-1252

Daniel Morissette dmorissette at mapgears.com
Wed Feb 9 07:34:36 EST 2011


On 11-02-08 09:37 AM, Siegel Andreas wrote:
> Hi.
> Our mapserver-eniromnent entirely works in utf-8 (mapfiles, webserver,
> postgres, ..) with one exception, that is, all of our shapefiles.
> The shapfiles are created/updated in an Windows-environment by several,
> external contributors.
> Hence they are encoded in Wiindows-ANSI (cp: 1252).
> If i do an GetFeatureInfo-Request on the attibutes of the shapefiles all
> special characters ("umlauts") are garbled.
> This is no wonder since the content of the shapefile-attributes must be
> recoded to utf-8 prior to insertion in the template.html.
> How can this be acomplished? I could not find anything useful in the
> documentation or with google.

The short answer is that there is no mechanism in MapServer at the 
moment to convert encoding of attributes displayed in a query template, 
so your only options are to either change the encoding of the data files 
to UTF-8, or change the template.html and its header to match the 
encoding of the data. (The only place where MapServer supports encoding 
conversion at the moment is in map labels, see the ENCODING keyword in 
the LABEL docs.)

Of course this could be a nice enhancement to MapServer if there was a 
group interested in funding it.

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


More information about the mapserver-users mailing list