Click to See Complete Forum and Search --> : Escape Characters


Shipwreck
01-12-2009, 08:57 PM
Hello!


I have gotten myself quite confused. I am trying to cultivate a positive development practice and would like some advice:

What is the deal with escape characters? For instance: & = &
I always try to escape ampersands, dashes, quotes, etc... but have never thoroughly understood why?

I read through this article (http://htmlpurifier.org/docs/enduser-utf8.html), but it's got me more confused than ever. Though it did have some good information.

If anybody could point me in the right direction in terms of which characters to escape and why, it would be greatly appreciated.


Thanks!
Noah

TheTeenScripter
01-12-2009, 09:09 PM
Pretty much all special characters (that are reserved for other uses) should be escaped. For example, "<" is used in html tags, "&" is used in the get methods for forms and certain scripting languages, etc. These characters should be escaped so that they don't get mis-interpreted by the browser.

Shipwreck
01-12-2009, 09:25 PM
I found this list of markup specific (http://www.webstandards.org/learn/reference/charts/entities/markup_entities/) characters. I am hoping that this is a convenient key for the best practice escape characters?

TheTeenScripter
01-13-2009, 11:08 AM
I found this list of markup specific (http://www.webstandards.org/learn/reference/charts/entities/markup_entities/) characters. I am hoping that this is a convenient key for the best practice escape characters?

Should be good