What’s the difference between an URL Encode and a HTML Encode?
I don't know what language you are working in, but the PHP manual for example provides good explanations.
URLEncode
Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application/x-www-form-urlencoded media type. This differs from the » RFC 1738 encoding (see rawurlencode()) in that for historical reasons, spaces are encoded as plus (+) signs.
If you want to encode for use in a URL, you use URL encoding.
If you want to encode for display on an HTML page, you HTML encode it
URL encode will encode characters so that they are valid for URLs. E.g. ?
becomes %3F
HTML encode will encode characters so they are valid for HTML. E.g. <
becomes <
HTML Encoding escapes special characters in strings used in HTML documents to prevent confusion with HTML elements like changing
"<hello>world</hello>"
to
"<hello>world</hello>"
URL Encoding does a similar thing for string values in a URL like changing
"hello+world = hello world"
to
"hello%2Bworld+%3D+hello+world"