[OpenLayers-Dev] OpenLayers.Request.POST an encoding

Andreas Hocevar ahocevar at opengeo.org
Tue Mar 17 07:03:37 EDT 2009


Hi,

2009/3/17 Dipl. Inf. Carsten Eider <eider at fh-bingen.de>:
> Hi list,
>
> i am using OpenLayers.Request.POST to send some xml data to
> a servlet. This data includes the famous german special charactesr like
> "ÜÖÄßüöä".
> Using tomcat on windows nearly everything works fine,
> using it on linux it fails
> The special characters result in "Ã?öÃ1/4ÃÃÃÃ"
> I know it is a encoding issue, but i don't know how to solve it
>
> Can i set the encoding on OpenLayers.Request.POST?

You can, e.g.:

var xhr = OpenLayers.Request.POST({
    ...
    headers: {
        "Content-Type": "text/xml; charset=utf-8"
    }
});

Regards,
Andreas.


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Dev mailing list