[OpenLayers-Dev] QueryString encode and decode problem

Andre Pereira de Matos andre.matos at co.sapo.pt
Wed Feb 11 07:03:39 EST 2009


Hi list,

I am trying to parse some query string parameters on my client code.

However, if there's some special characters in the query string, the browser itself will encode them in Unicode (equivalent to javascript escape function).
So, the problem is, the open layers code assumes the UTF-8 encode, and when the page loads the function OpenLayers.Util.getParameters will run, and throws an exception, because the url was encoded with the function escape (it is in Unicode) and the decode is done with decodeURIComponent function (decodes UTF-8).

Any solutions? Should OpenLayers.Util.getParameters function assumes the UTF-8 encode?

Regards
André Matos
http://maps.sapo.pt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20090211/cdd29adb/attachment.html


More information about the Dev mailing list