[mapserver-users] GetFeatureInfo XML result is not encoded at all

"SAEZ Laurent - CETE Méditerr./DI/ETER" Laurent.Saez at developpement-durable.gouv.fr
Wed Jun 25 08:10:16 EDT 2008


Hi list,

I have :

    * mapserver 4.99,
    * a mapfile utf-8 encoded,
    * a mapinfo file create on windows (encoding cp1252).

Extract of my mapfile (utf-8 encoded) :
"...
METADATA (of the map block)
...
    WMS_ENCODING "UTF-8"
END
...
METADATA (of my layer)
    WMS_TITLE "TRONCON_ROUTE par Classement_Administratif_Route"
    WMS_EXTENT "73114.958418 1622638.022606 1197702.049962 2676196.041411"
    gml_include_items 
"Id_Route120,Vocation,Nombre_Chaussees,Nombre_Voies,Ouverture,Acces,Reseau_Vert,Sens,Reseau_Europeen,Numero_Route,Classement_Administratif_Route,Longueur_Troncon"
gml_Nombre_Chaussees_alias "Nombre_Chaussées"
END
...."

I have to make WMS/GetFeatureInfo requests (with 
INFO_FORMAT=application/vnd.ogc.gml).
I've made several tests and it seems that :

    * WMS_ENCODING doens't encode anything. It just puts the right
      header of the XML returned (example : <?xml version="1.0"
      encoding="UTF-8"?>)
    * the XML tags name are putted as they're coded in the mapfile
      (example : <Nombre_Chaussées>1 chauss?e</Nombre_Chaussées>),
    * the XML tags values are putted as they're coded in the data source
      (example : see above).

So, if I change MWS_ENCODING to ISO-8859-1 (in my mapfile UTF-8 encoded) 
the only thing that changes is the XML header : <?xml version="1.0" 
encoding="ISO-8859-1"?>
The tags names and values are not encoded in ISO-8859-1. They're like 
I've explain above.
If I try to read my ISO-8859-1 GetFeatureInfo XML with FireFox, it warns 
that the XML is not well formed
(in my case at the line : <Nombre_Chaussées>2 
chaussées</Nombre_Chaussées>).

NB : I've tried with GML_ENCODING with the same results.

If I want all working right I have to :

   1. encode my mapfile into the same encoding than my data (it isn't
      very easy because I've mapinfo files in cp1252 and PostGIS data in
      utf-8),
   2. use WMS_ENCODING with ISO-8859-1 value (that is the default value).

I wonder if I have all understood !
I would like that someone explains to me what I have not understood 
and/or what I'm doing wrong.

Thanks for help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080625/287b3a3e/attachment.html


More information about the mapserver-users mailing list