[mapserver-users] WFS GetCapabilities does not work with non-ascii characters in mapfile

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Fri Feb 3 05:24:22 EST 2012


Hi,

Thank you for the information. I had a try by converting my Windows mapfile with iconv by using parameters -f ISO-8859-1 -t UTF-8. Now WFS GetCapabilities did not get truncated and it shows right:

<ows:Title>test_ö</ows:Title>
However, WMS GetCapabilities is a bit odd if "wms_title" is also given UTF-8 encoded.

<Title>test_ö</Title>

I can make both look right by using UTF-8 encoding for "wfs_title" and ISO-8859-1 encoding for "wms_title" inside the same mapfile. In a way funny but not very convenient situation. 

-Jukka Rahkonen-


Eichner, Andreas - SID-NLKM wrote:

> 
> This is due to the usage of libXML2. Its internal data format 
> is UTF-8 and MapServer has no way to deal with different map 
> file encodings. Therefore libXML2 aborts due to invalid UTF-8 
> input data on serialization. Transcode your map file to UTF-8 
> and it should work.
> Note that libXML2 is _not_ used for WMS and older WFS 
> services. These use plain fprintf() to write data out as is. 
> So you might encounter crazy things when trying to use 
> different encodings on data, map file and web server output.
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: mapserver-users-bounces at lists.osgeo.org 
> > [mailto:mapserver-users-bounces at lists.osgeo.org] Im Auftrag 
> > von Rahkonen Jukka
> > Gesendet: Freitag, 3. Februar 2012 10:24
> > An: 'mapserver-users at lists.osgeo.org'
> > Betreff: [mapserver-users] WFS GetCapabilities does not work 
> > with non-ascii characters in mapfile
> > 
> > Hi,
> >  
> > This should be simple to test and verify.
> > Write into WEB METADATA parameters
> >  
> >  "wms_title" "test_ö"
> >  "wfs_title" "test_ö"
> >  
> > WMS 1.1.1 GetGapabilities does not have any trouble with "ö" 
> > and request sends back
> > ...
> > <Service>
> >   <Name>OGC:WMS</Name>
> >   <Title>test_ö</Title>
> > ....
> >  
> > However, WFS GetCapabilities response gets truncated. All 
> > that Mapserver sends is this
> >  
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <wfs:WFS_Capabilities xmlns:gml="http://www.opengis.net/gml" 
> > xmlns:wfs="http://www.opengis.net/wfs" 
> > xmlns:ows="http://www.opengis.net/ows" 
> > xmlns:xlink="http://www.w3.org/1999/xlink" 
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> > xmlns:ogc="http://www.opengis.net/ogc" 
> > xmlns="http://www.opengis.net/wfs" version="1.1.0" 
> > xsi:schemaLocation="http://www.opengis.net/wfs 
> > http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
> >   <ows:ServiceIdentification>
> >     <ows:Title>test_
> >  
> >  
> > The same error occurs if non-ascii characters are used in 
> > "wfs_abstract". 
> > I was testing on Windows and Mapserver 6.0.1.
> >  
> > -Jukka Rahkonen
> > 
> 


More information about the mapserver-users mailing list