@ converted to %40 in GET
Asked Answered
M

1

6

I'm using http://jquery.malsup.com/form/ and I'm posting an e-mail address to a url using GET.

It looks like the @ in the email address is being converted to %40.

Will this be an issue for the site capturing the data?

Mush answered 9/3, 2012 at 9:9 Comment(2)
Click and look at the url: google.com/…Hexahedron
Did you actually try answering the question yourself? Also no, I don't think so, as long as you use urldecode().Aliped
A
21

%40 is the URL-encoded version of @. This conversion only takes place in the URL. The server will still see it as @, and if necessary you can even use JavaScript to decode it:

decodeURIComponent('%40'); // '@'
// or, to encode it back:
encodeURIComponent('@'); // '%40'

Here’s an example of a URL that will get parsed as you’d expect on the server-side:

http://mathiasbynens.be/demo/get?x=%40

If you visit the page, you’ll see that it prints @, not %40.

Here’s an example of a URL that will get parsed as you’d expect on the client-side, by using decodeURIComponent:

http://mothereff.in/byte-counter#%40

If you visit the page, you’ll see that the textarea’s contents are set to @, not %40.

Accident answered 9/3, 2012 at 9:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.