Hi,
I have an encoding problem and I think it is because 
OpenLayers.Control.WMSGetFeatureInfo assign UTF-8 has encoding.
If so, My question is how to deal with the encoding iso-8859-1 of the data 
(record of a sql server DB), when using 
OpenLayers.Control.WMSGetFeatureInfo?

Here is my problem...
I want to make a getFeatureInfo on a wms layer (mapserver) using 
OpenLayers.Control.WMSGetFeatureInfo. 
Before, I sent a request manually directly in the browser and the result 
from mapserver is good. The mapserver html template and the data in the 
sql server DB are encoded iso-8859-1.
As a result I see this per example Catégorie: Infection à la gorge 

But when I send the same getFeatureInfo request with 
OpenLayers.Control.WMSGetFeatureInfo and show the result using 
map.addPopup(new OpenLayers.Popup.FramedCloud(...))
 In the popup or in an alert() window I see this:
Cat?gorie: Infection ? la gorge 

I think the problem is that the browser or OL (I'm not sure are that 
works) think that the html is encoded with utf-8 but it is not. 
Before showing the popup, i tried to lauch a php script using ajax and 
this function mb_detect_encoding( $txt, "auto" )); returns UTF-8. 
I tried several function such using utf8_encode(), utf8_encode(), mixed 
with mb_convert_encoding($str, 'UTF-8') without success.

if I encode the mapserver html template in UTF-8 and launch the 
WMSGetFeatureInfo, I get this in the popup
Catégorie: Infection ? la gorge 

Catégorie is hardcoded in the html template
"Infection ......" comes from an sql server database encoded with 
iso-8859-1

So using utf-8 fixed the hardcoded text, but how to deal with the encoding 
of the DB data?
Sorry if all this is confusing, even in french I would not be good at 
explaining my problem...
Thanks
Steve
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to