On 26 juin, 10:13, Morpheu5 <[email protected]> wrote:
> Hi, thanks for the replies.
> The code is as simple as you can imagine: urlencoding and post request
> on the client side (as copypasted from examples I found on the
> Internet and slightly modified to suit my needs), $_POST dumping on
> the server side.
> Anyway, the problem was apparently only appearing with contents from
> TinyMCE editor, not from other fields, and this is a thing I didn't
> really notice before. Thanks to Ian, I switched to encodeComponent()
> and everything seems to work now. By the way, what's the difference
> between encode() and encodeComponent()?

encode() takes a URL and gives you a URL:
   encode("../this contains/some?çhar=àacters#that need ùrl€ncoding")
will give you:
   ../this%20contains/some?%C3%A7har=%C3%A0acters#that%20need
%20%C3%B9rl%E2%82%ACncoding

while encodeComponent() is for "URL components" (path segments, etc.).
The same input as above given to encodeComponent() would return:
   ..%2Fthis%20contains%2Fsome%3F%C3%A7har%3D%C3%A0acters%23that%20need
%20%C3%B9rl%E2%82%ACncoding


--~--~---------~--~----~------------~-------~--~----~
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