URIencode and colon

colon is a character that can be encoded to "% 3A" across many sites and when I try to encode with URIencode

it doesn't work

for example if I try to code like URIencode(':');

then nothing happens. the colon is returned. Why is this?? can someone help me here.

Thanks in advance.

+3


source to share


1 answer


encodeURI()

encodes special characters except:

, / ? : @ & = + $ #



You should use this instead encodeURIComponent(':');

This function encodes special characters. Also, it encodes characters missingencodeURI()

+10


source







All Articles