[英]Do I need to use HTML entities for special characters if I'm using the UTF-8 charset?
A site I'm working on is switching from ISO. 我正在研究的网站正在从ISO转换。 If the HTML character set is set to UTF-8, do I still need to replace
©
, é
, …
, etc with the appropriate HTML entity? 如果HTML字符集设置为UTF-8,是否仍需要用适当的HTML实体替换
©
, é
, …
等?
No, symbols like ©
, é
, …
, the German umlauts ä
, ö
, ü
, ß
and all the other stuff can be used just like any other character when using UTF-8. 不,使用UTF-8时,像
©
, é
, …
,德国变形金刚ä
, ö
, ü
, ß
和所有其他东西的符号可以像任何其他角色一样使用。
But note that some things still have to be entities because they have a special meaning in HTML ( <
and >
for example, which should still be replaced with >
and <
if you want to use them in your text) 但请注意,有些内容仍然必须是实体,因为它们在HTML中具有特殊含义(例如,
<
和>
,仍应替换为>
和<
如果要在文本中使用它们)
in short : No you don't, actually I would even advise not to use them anymore. 简而言之:不,你没有,实际上我甚至建议不再使用它们。 A possible legacy usage would be in some html pages links and forms "gets", but even here usually we can deal without.
可能的遗留用法是在一些html页面链接和表单“获取”,但即使在这里,我们通常可以不用处理。
Depends also on how you generate / edit your content. 还取决于您如何生成/编辑您的内容。 If you have users editing files locally on Windows and what not, it may be safer to stick to entities after all.
如果你有用户在Windows上本地编辑文件而不是,那么毕竟坚持实体可能更安全。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.