HTML Unicode 问题:如何显示特殊字符

发布于 2024-12-28 04:41:12 字数 101 浏览 2 评论 0原文

目前,我的网页设置为 Unicode/UTF-8。当尝试显示特殊字符(例如长破折号、双箭头等)时,它会显示为问号符号。我无法将这些字符更改为等效的 HTML 实体。我怎样才能规避这个问题?

Currently, I have my webpage set to Unicode/UTF-8. When trying to display a special character (for example, em dash, double arrow, etc), it shows up as a question mark symbol. I cannot change these characters to the HTML entity equivalent. How can I circumvent this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

半仙 2025-01-04 04:41:12

菱形问号 � 表示字符级错误:根据所应用的字符编码,数据包含不代表任何字符的字节。当文档声明为 UTF-8 编码但实际上采用 iso-8859-1、windows-1252 或某些类似编码时,通常会发生这种情况。 Windows-1252 是 Windows 平台上各种程序使用的常见默认编码。因此,您可能需要在创作程序中打开该文件并将其重新保存为 UTF-8 编码。

如果问题仍然存在,请发布 URL。单独发布代码是不够的,因为字符编码主要在 HTTP 标头中指定。

如果您在小框中看到问号,则可能是字体级问题(所使用的字体中缺少字形),但对于像破折号这样的常见字符来说,这种情况非常罕见。不同的浏览器有不同的方式来指示字符或字体级别的问题。

A question mark in a lozenge, �, indicates a character-level error: the data contains bytes that do no represent any character, according to the character encoding being applied. This typically happens when the document is declared as UTF-8 encoded but is really in iso-8859-1, windows-1252, or some similar encoding. Windows-1252 is a common default encoding used by various programs on Windows platforms. So you may need to open the file in your authoring program and re-save it as UTF-8 encoded.

If problems remain, please post the URL. Posting the code alone is not sufficient, since the character encoding is primarily specified in HTTP headers.

If you see a question mark in a small box, then it might be a font-level problem (lack of glyph in the fonts being used), but this would be very rare for common characters like the em dash. Different browsers have different ways of indicating character- or font-level problems.

望喜 2025-01-04 04:41:12

确保您的文档在实际代码编辑器以及文档类型中设置为正确的字符编码。两者都是必要的。当唯一的问题是我需要在 Coda 中设置文本设置时,我花了几个小时尝试调整 HTML。

<head>
    <meta charset="utf-8">

请参阅以下屏幕截图:

在此处输入图像描述

Make sure your document is set to the correct character encoding in the actual code editor, as well as in the doctype. Both are necessary. I spent hours trying to tweak HTML when the only problem was that I needed to set the text setting in Coda.

<head>
    <meta charset="utf-8">

See the following screenshot:

enter image description here

别低头,皇冠会掉 2025-01-04 04:41:12

确保您的字符实际上是 UTF-8 字符。它们可能看起来像这样:

® or U+0020

http://www.kinsmancreative.com/transfer/char /index.php 是一个方便的网站,如果您需要参考,可以查找常用 UTF-8 特殊字符的十进制值。

Make sure your characters are actually UTF-8 characters. They will probably look something like this:

® or U+0020

http://www.kinsmancreative.com/transfer/char/index.php is a handy site for finding the decimal values of commonly used UTF-8 special characters if you need a reference.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文