Reputation: 8880
My understanding of HTML5 is tht when one has got
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
in the document header the only characters that need to be converted to entities are > < & ' and ".
Upvotes: 1
Views: 328
Reputation: 3848
The chars < > &
are special. They are required to be escaped, so the parser isn't confused and you are able to display them. That's independent of the charset.
Older charsets are not able to display things like ä ö ü ß
, so you have to escape them. In UTF-8 you don't need to use the entities, because the encoding supports them native and they don't confuse with XML syntax.
' "
are also special but only in attributes, where you want to ensure that a double quotation can be inside of a double quote notated attribute (the like with a single quote char inside of single quotes attribute).
It's like other languages where you can exchange to notation, for example '"'
and "'"
. Now if you are building the value from a database, you don't have to swap quotes around, you can simply escape them using entities.
Upvotes: 2