I have a question about url encode/decode. When I url decode "%2E", I get ".". But when i url encode ".", I get "."
I try that in web site like http://www.url-encode-decode.com/. Can you please tell me why is that?
I have a question about url encode/decode. When I url decode "%2E", I get ".". But when i url encode ".", I get "."
I try that in web site like http://www.url-encode-decode.com/. Can you please tell me why is that?
"." is one of the characters (full list here) that is allowed to be used in url in unencoded form. So there is no reason to encode it to its hex representation. That's why you are getting:
"." -> encode -> "."
On the other hand every charater CAN be replaced by its hex representation using "%" syntax. This is why you are getting:
"%2E" -> decode -> "."
So you will get this behaviour for every character that is allowed in url in unecoded form:
"a" -> encode -> "a"
"%61" -> decode -> "a"
And this is a valid url for google.com: