If my site is using UTF-8, is there any advantage/disadvantage to still escaping HTML characters? e.g. Using "&” instead of just “&“? What’s the best practice?
If my site is using UTF-8, is there any advantage/disadvantage to still escaping HTML
Share
You still need to escape characters that have a special meaning in HTML, like
<,>,&, to avoid parser ambiguities/invalid syntax. That has nothing to do with the encoding. You don’t need to escape every non-ASCII character though, like “ö” toö, since you can natively represent them in the UTF-8 encoding.