[mapserver-users] AJAX - GetFeatureInfo - Accent problem

bartvde at osgis.nl bartvde at osgis.nl
Thu Apr 24 06:17:17 PDT 2008


<48108382.1050104 at mapgears.com> <48108541.1020300 at mapgears.com>
Message-ID: <c578de2a3c0c4ef335a669eb215b2007 at pop02.backbone.tiscomhosting.nl>
X-Sender: bartvde at osgis.nl
Received: from b50-11.minvenw.nl [145.50.39.11] with HTTP/1.1 (POST); Thu, 24
	Apr 2008 15:17:17 +0200
User-Agent: RoundCube Webmail/0.1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

AJAX (in IE) won't pick up the content-type from the HTML of XML file, but
will look at the charset of the http header Content-Type.

See also:

http://trac.osgeo.org/mapserver/ticket/2583

If you have a proxy in between, you can do it in the proxy code, otherwise
you can maybe use Apache to add a charset to the http headers.

Best regards,
Bart

On Thu, 24 Apr 2008 09:04:01 -0400, Daniel Morissette
<dmorissette at mapgears.com> wrote:
> 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/
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list