html没有在firefox中正确显示内容

时间:2014-01-05 09:25:32

标签: html unicode character-encoding

我有一个HTML文件。当我在文本编辑器中打开时,它显示如下。

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
      <html>

      <head>
          <title>Srimad Bhagavatam Canto 4 Chapter 9 Verse 5</title>
          <link rel="STYLESHEET" href="../../../om.css" type="text/css" title="om tat sat">
          <meta http-equiv="Content-Type" content="text/html; Charset=ISO-8859-1">
          <meta name="KEYWORDS" content="Srimad Bhagavatam">
          <meta name="DESCRIPTION" content="Srimad Bhagavatam Canto 4 Chapter 9 Verse 5">
      </head>

      <body>
          <p class="h">4.9.5</p>
          <p class="c">sa vai tadaiva pratipāditāḿ giraḿ</p>
          <p class="c">daivīḿ parijñāta-parātma-nirṇayaḥ</p>
          <p class="c">taḿ bhakti-bhāvo 'bhyagṛṇād asatvaraḿ</p>
          <p class="c">pariśrutoru-śravasaḿ dhruva-kṣitiḥ</p>
          <p class="t">TRANSLATION</p>
          <p>At that time Dhruva Mahārāja became perfectly aware of the Vedic conclusion and understood the Absolute Truth and His relationship with all living entities. In accordance with the line of devotional service to the Supreme Lord, whose fame is widespread,
              Dhruva, who in the future would receive a planet which would never be annihilated, even during the time of dissolution, offered his deliberate and conclusive prayers.</p>
      </body>

      </html>

当我在firefox中打开这个html文件时。输出是

    4.9.5

    sa vai tadaiva pratipÄditÄmÌ giramÌ

    daivÄ«mÌ parijñÄta-parÄtma-nirnÌ£ayahÌ£

    tamÌ bhakti-bhÄvo 'bhyagrÌ£nÌ£Äd asatvaramÌ

    pariÅ›rutoru-Å›ravasamÌ dhruva-ksÌ£itihÌ£

    TRANSLATION

    At that time Dhruva MahÄrÄja became perfectly aware of the Vedic conclusion and understood the Absolute Truth and His relationship with all living entities. In accordance with the line of devotional service to the Supreme Lord, whose fame is widespread, Dhruva, who in the future would receive a planet which would never be annihilated, even during the time of dissolution, offered his deliberate and conclusive prayers.

我无法理解这个问题,为什么要更改diacratics并显示一些错误的字母?

3 个答案:

答案 0 :(得分:2)

请尝试更改

<meta http-equiv="Content-Type" content="text/html; Charset=ISO-8859-1">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

ISO 8859-1是单字节编码,仅包含前256个unicode字符。

答案 1 :(得分:0)

@geedubb打败了我,这就是解决方案。要展开,UTF-8可以代表每个unicode角色,而@geedbubb指出ISO 8859-1是有限的。

答案 2 :(得分:0)

最简单的解决方法是在文本编辑器中以UTF-8编码保存文件 带有BOM的 。任何合理的文本编辑器都有一个命令。

这将覆盖文档本身甚至HTTP头中的任何字符集声明。

然后,您可以将标记<meta http-equiv="Content-Type" content="text/html; Charset=ISO-8859-1">删除为无效。如果您希望将其保留用于文档目的,则需要将ISO-8859-1更改为UTF-8

ISO-8859-1仅适用于西欧和北欧语言(甚至不适用于它们)。对于页面中的文本(科学/学术音译中的梵文文本),UTF-8是唯一在网页上有意义的字符编码。