[OpenLayers-Users] wfs server and encoding

Arnd Wippermann arnd.wippermann at web.de
Fri Oct 26 18:29:09 EDT 2007


Hello Eric,

I'm not quite convinced, because OL get the data via Ajax and Ajax know only
UTF-8. Nevertheless are my attributes not correct written.

Also in my second example there are many german Umlaute and the WFS-layer
are shown.

Here some different Views on the responsed data (FF and Firebug):

Firebug Console Response:
-------------------------

<?xml version='1.0' encoding="ISO-8859-1" ?>
<wfs:FeatureCollection
...
        <ms:GEOOBJEKT>Grünewalder Berg - Schusterstraße (1)</ms:GEOOBJEKT>

###################

Open Location in new tab :
--------------------------

	<wfs:FeatureCollection
<ms:GEOOBJEKT>Grünewalder Berg - Schusterstraße (1)</ms:GEOOBJEKT>
        
and Save
--------

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:FeatureCollection
        <ms:GEOOBJEKT>Grünewalder Berg - Schusterstraße (1)</ms:GEOOBJEKT>

###################

This shows, that the the received data is in iso-8859-1 and OL shows the
geometry and (there was a mistake by me) the german Umlaute in my attributes
in the right way.

This means, if I have data in "iso-8859-1" and deliever them through
MapServer, than all goes well. And if the data in utf-8 (like the data from
SQLite), I set in my proxy Response.CharSet = "UTF-8" and inspite of the XML
header <?xml version='1.0' encoding="ISO-8859-1" ?> the german Umlaute are
right displayed.

Learning will never ending. Now I know, how to convert xml files from i.e.
"iso-8859-1" to "utf-8", but I don't need the conversion for OL. 

What I not understand (I have it not looked up), get OL the WFS data with
Ajax?

Ajax understands only "utf-8". Why are then my attribute values right?

The next thing I have to consider, is how to get the german Umlaute in the
right way from my application into my database (SQLite with "utf-8" and
Access with "iso-8859-1").

Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/





More information about the Users mailing list