Are HTML entities still useful or should I simply create UTF-8 encoded html documents? Please explain why.
Entities are frequently used to display reserved characters (which would otherwise be interpreted as HTML code), and invisible characters (like non-breaking spaces). You can also use them in place of other characters that are difficult to type with a standard keyboard.
You use entities to help the parser distinguish when a character should be represented as HTML, and what you really want to show the user, as HTML will reserve a special set of characters for itself.
If the encoding is set correctly (and the document is saved as UTF-8) you should be able to work with just the characters. From the W3C:
Using an encoding such as UTF-8 means that you can avoid the need for most escapes and just work with characters.
http://www.w3.org/International/questions/qa-escapes
However, you still need to use entities for special characters such at greater/less than.
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