简体   繁体   中英

html not showing content properly in firefox

I have an HTML file. When I open in the text editor it shows the below.

 <!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>

When i open this html file in firefox. the output is

    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.

I am not able to understand the problem, why its changing the diacratics and showing some wrong letters?

Please try changing

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

to

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

ISO 8859-1 is a single-byte encoding that only includes the first 256 unicode characters.

@geedubb beat me to it, that is the solution. to expand, UTF-8 can represent every unicode character while as @geedbubb points out ISO 8859-1 is limited.

The simplest fix is to save the file, in your text editor, in UTF-8 encoding with BOM . Any reasonable text editor has a command for this.

This will override any charset declaration in the document itself and even HTTP headers.

You can then remove the tag <meta http-equiv="Content-Type" content="text/html; Charset=ISO-8859-1"> as useless. If you wish to retain it for documentation purposes, you need tp change ISO-8859-1 to UTF-8 , of course.

ISO-8859-1 is sufficient for Western and Northern European languages only (and not really even for them). For texts like those in your page (Devanagari text in scientific/academic transliteration), UTF-8 is the only character encoding that makes sense on web pages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM