何时使用 ASCII 字符代码?
我使用 ©
作为版权标志。我需要用 ASCII 字符代码替换网页上的哪些内容?我的页面上也有 ',",我是否需要用 ASCII 字符代码替换它们?
使用 ASCII 字符代码时是否需要使用以下内容?我什么时候会使用它:
<meta http-equiv="content-type" content="text/html;charset=utf-8">
更新:
我正在使用 YUI API 和他们建议我使用严格的文档类型:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
现在会如何改变以及我需要什么来表示版权符号?
I am using ©
for the copyright sign. What all do I need to replace on my web page with the ASCII character codes? I also have '," on my page, do I need to substitute these also with the ASCII character codes?
Do I need to use the following when using ASCII character codes? When would I use it else:
<meta http-equiv="content-type" content="text/html;charset=utf-8">
UPDATE:
I am using the YUI API and they suggest that I use the strict doc type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
How would this change now and what all do I need to represent the copyright symbol?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您正在编写 XHTML 并且希望能够在包含非外部实体的 XML 解析器中或在没有外部实体的 XHTML5 中处理它,则不能使用
©
DTD 定义copy
实体。在这种情况下,您可以使用
©
,或者通常更好的是,直接粘贴 © 符号,并确保以 UTF-8 格式保存和提供文件。You can't use
©
if you're writing XHTML and you want to be able to process it in a non-external-entity-including XML parser, or in XHTML5 where there is no DTD to define thecopy
entity.In this case, you might use
©
, or, generally better, just paste the © symbol in directly and make sure you're saving and serving the file as UTF-8.© 符号不存在 ASCII 码,它不是 ASCII 的一部分。
有关详细信息,请参阅关于 ASCII 的维基百科页面。
在我看来,像
©
这样的符号名称总是比任何神奇的数字表示更好。There is no such thing as the ASCII code for the © symbol, it is not part of ASCII.
Please see the wikipedia page on ASCII for details.
In my opinion, a symbolic name such as
©
is always better than any magical numerical representation.UTF 中的 U 来自 Unicode。在编码为 UTF-8 的 HTML 文档中,当您想要插入文字
<
时,只需需要使用 HTML 实体,并且根据上下文插入文字>
或文字引号。当您想要键入键盘上没有的字符(例如©)时,您也可以使用它们。The U in UTF comes from Unicode. In an HTML document encoded as UTF-8 you only need to use HTML entities when you want to insert a literal
<
and, depending on the context, a literal>
or a literal quotation mark. You also can use them when you want to type a character that's not in your keyboard, such as ©.