views:

297

answers:

1

I'm confused as for the difference between the terms "escaping" and "encoding" in phrases like:

Xml Encoding

Xml Escaping

Encoded Html

Escaped Url

...

Can anyone explain it to me?

+5  A: 

Encoding describes how the file's characters are physically written in binary (as in Unicode or ANSI).

Escaping refers to the process of replacing special characters (such as < and >) with their XML entity equivalent (such as &lt; and &gt;). For URLs, escaping refers to replacing characters with strings starting with %, such as %20 for a single whitespace.

Escaping differs by language, but encodings are usually widely-accepted standards. Sometimes the terms are used ambiguously (particularly with encoding used to mean escaping), but they are well defined and distinct.

Welbog
Good definitions! +1
Cerebrus
A pedantic clarification: "unicode" is not an encoding but a character set (UTF-8, ISO8859-1, CP850 are examples of encodings). Sadly, Unicode and UTF-8 are often used as synonymous while they are not.
tokland