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?

Ben Paton
  • 1,432
  • 9
  • 35
  • 59
  • Click and look at the url: http://www.google.com/#bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=8fc685d9ca728249&hl=en&q=%40 – Thomas Clayson Mar 09 '12 at 09:11
  • Did you actually try answering the question yourself? Also no, I don't think so, as long as you use [urldecode()](http://de.php.net/manual/de/function.urldecode.php). – Harti Mar 09 '12 at 09:12

1 Answers1

20

%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.

Mathias Bynens
  • 144,855
  • 52
  • 216
  • 248