Why does URLEncodedFormat () in CFML encode valid URL characters?

What is the reason URLEncodedFormat() escapes for valid URL characters?

valid characters:

 - _ . ! ~ * " ( ) 

CF8 Doc said: "[ URLEncodedFormat() escapes] non-alphanumeric characters with equivalent hexadecimal escape sequences." However, why avoid valid URL characters?

+6
coldfusion urlencode
source share
3 answers

They are valid, but it seems perfectly normal to me that if you ask the programming language to encode a string that converts all non-phase numeric characters to the hexadecimal equivalent.

ASP Server.URLEncode () does the same and php urlencode () too, with the exception of - and _. In addition, in javascript, the encodeURIComponent () function will encode all non-phase numeric characters to hexadecimal equivalents.

It is a good idea to somehow encode all non-abedic numeric characters when using user input to form server requests to prevent something unexpected.

+11
source share

Is encoding of valid url characters causing an error or problem?

One problem may be that, without doing so, if you insert a link with non-encoded characters in an email, the email software may decide to split the link into two lines.

If you use a fully encoded URL, however, the likelihood of this is greatly reduced. Only one way to see this.

+1
source share

I could see, at least in the case of β€œwhat would be nice if it were encoded using the URL as a link in the anchor tag.

0
source share

All Articles