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?
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 <
and >
). 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.