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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With