我还应该使用 html 实体吗?为什么? [英] Should I still use html entities? Why?

查看:27
本文介绍了我还应该使用 html 实体吗?为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML 实体是否仍然有用还是我应该简单地创建 UTF-8 编码的 html 文档?请解释原因.

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

推荐答案

如果编码设置正确(并且文档保存为 UTF-8),您应该能够只处理字符.来自 W3C:

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:

使用诸如 UTF-8 之类的编码意味着您可以避免大多数转义的需要,而只需处理字符.

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.

这篇关于我还应该使用 html 实体吗?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆