Should I still use html entities? Why?

前端 未结 3 1015
北荒
北荒 2020-12-09 03:23

Are HTML entities still useful or should I simply create UTF-8 encoded html documents? Please explain why.

3条回答
  •  粉色の甜心
    2020-12-09 03:54

    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.

提交回复
热议问题