colon is a character which can be encoded to '%3A' as per many sites and when I try to encode using URIencode
it is not working
for example if I try to encode like URIencode(':');
then nothing happens. colon is returned. Why is this?? can someone help me out here.
Thanks in advance.
colon is a character which can be encoded to '%3A' as per many sites and when I try to encode using URIencode
it is not working
for example if I try to encode like URIencode(':');
then nothing happens. colon is returned. Why is this?? can someone help me out here.
Thanks in advance.
Share Improve this question asked Feb 14, 2013 at 10:25 Jaya MayuJaya Mayu 17.2k34 gold badges115 silver badges149 bronze badges 1- 2 Take a look @ What is the difference between decodeURIComponent and decodeURI? – Alex K. Commented Feb 14, 2013 at 10:27
1 Answer
Reset to default 20The encodeURI()
encodes special characters, except:
, / ? : @ & = + $ #
You should use this instead encodeURIComponent(':');
This function encodes special characters. In addition, it encodes the characters skipped by encodeURI()