[mapserver-users] AJAX - GetFeatureInfo - Accent problem

Daniel Morissette dmorissette at mapgears.com
Thu Apr 24 06:04:01 PDT 2008


OOpps... sorry for responding to myself, but I just realized that you 
are using an HTML template for your GetFeatureInfo query and not GML. In 
this case the ows_encoding setting will have no effect. However you 
could and should set the encoding yourself in the header of the query 
template.

Daniel


Daniel Morissette wrote:
> Martin,
> 
> Did you try setting "ows_encoding" "ISO-8859-1" in the map-level 
> metadata? With this metadata directive, MapServer will include an 
> encoding value in the <?xml ...> header of the GetFeatureInfo response, 
> and hopefully that will be caught by the XMLHttpRequest.
> 
> Daniel
> 
> Martin Ouellet wrote:
>> Hi,
>>
>> I have a GetFeatureinfo request that work pretty well (the accent 
>> character is OK) )when I call it directly in IE or FF:
>>
>> http://MDRIM00-000251/mapserver5/siglight.exe&service=WMS&version=1.1.1&request=getfeatureinfo&info_format=text/html&srs=EPSG:4326 
>> <http://MDRIM00-000251/mapserver5/siglight.exe&service=WMS&version=1.1.1&request=getfeatureinfo&info_format=text/html&srs=EPSG:4326> 
>>
>> &bbox=-71.332572,46.716784,-71.247428,46.783216&width=992&height=774&layers=hauteur_libre&query_layers=hauteur_libre&feature_count=10&x=423&y=313&format=gif&styles= 
>>
>>
>> ex: Municipalité: Québec
>>
>> The template behind this layer is a very simple HTML file (saved in 
>> DOS/ISO-8859-1 encoding):
>>
>> <table border="0" cellpadding="0" width="100%" class="gfi-label">
>>     <tr valign="top">
>>         <td align="right">Municipalité:</td>
>>         <td class="gfi-value">[Municipali]</td>
>>     </tr>
>> </table>
>>
>> But when I send the same URL request in AJAX, the accent character are 
>> not displayed correctly (in the responseText of the XMLHttpRequest 
>> object).
>>
>> ex: Municipalit?  Qu?c
>>
>> For firefox, I have fix the problem by adding this line:
>>
>> xmlHttp.overrideMimeType('text/html; charset=ISO-8859-1');
>>
>> But this method is not supported by IE.  I presume it's not a 
>> Mapserver issue but if someone has any clue???
>>
>> Thank you in advance.
>>
>> MartinO
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 


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



More information about the MapServer-users mailing list