On 27 mar, 17:45, darkflame <[email protected]> wrote:
> I got data being recieved in my GWT program from a PHP function which
> is using urlencode(string) to encode the data.
>
> What do I need to do on the GWT to correctly decode this data?
>
> I tried just  " URL.decode(string) " but this clearly isnt decodeing
> it correctly (slash's, for example, are still "+%2F")
>
> What other decodeing functinos are there?

URL.decodeComponent(String) is the thing to use to decode PHP's
urlencode(string) result.

URL.encode()/URL.decode() is designed to work with full URLs (i.e.
turn "http://example.net/foo bar/bâz?q=uüx" into "http://example.net/
foo%20bar/b%C3%A2z?q=u%C3%BCx")

See:
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURI
(the thing behind URL.decode())
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURIComponent
(the thing behind URL.decodeComponent())

And if you plan using URL.encodeComponent, see
http://code.google.com/p/google-web-toolkit/issues/detail?id=3374


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to