html not showing content properly in firefox - html

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.

Related

Arabic language not displaying in Notepad

peace upon you
I have a problem with the language when I was in the notepad
An idea about the subject
I tried to put metadata utf-8
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
It doesn't show the arabic words, it shows question marks instead
Include the two tags inside your paragraph marker:
dir="rtl"
lang="ar"
رَبٍّ زِدْنٍي عِلمًا
<p dir="rtl" lang="ar" style="color:#e0e0e0;font-size:20px;">رَبٍّ زِدْنٍي عِلمًا</p>
Here the meta tag you can use if you are using notepad.
**<meta content="text/html; charset=utf-8" http-equiv=Content-Type>**
if you are using modern text editor like sublime you don't need to put that.

Turkish characters does not display correctly

i have the following code. it contain Turkish content. but i get the results including special charecter. so please give solution for that.
html code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<META HTTP-EQUIV="content-language" CONTENT="TR" />
<title>test</title>
</head>
<body>
Tarihçe
</body>
</html>
i will get Tarih�e instaed of Tarihçe.
If you can use Turkish encoding below will be the meta tag
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
else code Tarihçe as
Tarihçe
Change the actual character encoding of the file to UTF-8, using whatever settings need to be used in the program you use to create and edit pages. The file is now in some 8-bit encoding, so the letter ç appears in the data as a byte that is not allowed in UTF-8; hence the � symbol (it indicates character-level data error).

Cant see greek menu text and titles the paragraph greek text is alright

I have my website in english and now I want to make it in greek, but the greek text it wont show in the menu bar and titles but some symbols... though the paragraph greek text looks just fine.
I have
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Any idea what's wrong?
The HTML lang attribute can be used to declare the language of a Web page. This is meant to assist search engines and browsers.
According to the W3C recommendation you should declare the primary language for each Web page with the lang attribute inside the tag, like this:
ISO 639-1 Language Code of greek is el
<html lang="el">
...
</html>
In XHTML, the language is declared inside the tag as follows:
<html xmlns="http://www.w3.org/1999/xhtml" lang="el" xml:lang="el">
...
</html>
Some Greek characters are part of the Unicode character set, so you need to declare that in the head of your documents:
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
you may check for special characters though this website

special characters not showing on page

I have meta tag as given below:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"/>
<meta name="keywords" Content="“SAT Course†“SAT exam†“SAT Prep†“SAT Preparation Courseâ€" />
<meta name="description" Content="Take Kaplan’s SAT preparation course. We use proven score raising strategies and give you access to 4 practice tests so you can take the test with confidence." />
<meta name="copyright" Content="Copyright Kaplan Test Prep and Admissions 2008" />
<meta name="Content-language" Content="en-uk" />
<meta name="Distribution" Content="global" />
<meta id="tcm" name="TMCID" Content="tcm:55-7918-64"></meta>
it was working fine but after some changes it start behaving differently. it is not showing special character properly some extra text is added on the page.
I have tried using charset='utf-8'.
Please suggest! what can be reason behind this.
The character set you have used to save the HTML in does not match the character set the browser thinks is being used. Check your editor to find out what you are really using.
I recommend setting it to UTF-8. This is a well supported encoding that supports just about any character you are likely to use, along with a large number that you aren't.
Note that the encoding you specify using meta tags does not override any encoding specified in real HTTP headers sent by your webserver. See http://www.w3.org/International/O-HTTP-charset for advice on how to change it.
As an aside, if you mean the language is "British English" then you want "en-gb" not "en-uk".

HTML <head> best practices [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
There are <meta> tags and other things you can place in the <head> of your HTML document. What <meta> tags etc. and best practices do you make use of in your HTML document to make it more accessible, searchable, optimized etc.
In my case:
Title (should do [Section Name - Site Name] for better SEO)
Meta tag for Content-type, description, and keywords
Link to stylesheet(s) (don't forget to specify the media="").
<script> tag that links to external javascript files.
All tags should follow the W3C's standard. The W3C site has a more technical and detailed section about the HTML <head> section.
Do your users a favor and make their IE engine switch to Chrome one when Chrome Frame is installed :)
<meta http-equiv="X-UA-Compatible" content="chrome=1">
You'll want to put SCRIPT elements at the end of the page before the close of the BODY element. See http://developer.yahoo.com/performance/rules.html#js_bottom for details.
Besides the usual doctype, title, etc, I will try and provide you with some things I have learned and implemented that might be of assistance to you.
Firstly, remember that the title, for best user experience should have the most relevant sub section first. This is because it is usually displayed in the title bar/tab list/bookmark name. Consider this page title...
Stack Overflow - HTML head best practices
becomes Stack Overflow... (munched to save room in tab bar/bookmark list)
Now if you had 5 Stackoverflow tabs open (as I often do :P) then how would the user know which one is which?
Also note with CSS the cascading nature... So the order of these will matter. Same with Javascript, any dependencies on other external sites must be allowed for. I put mine in the head and havn't noticed a performance decrease. I put them there because it to me looks more tidy and logical. Though some other people will recommend putting the <script src=""> links in just before </body> so the browser won't temporarily stall... Just use whatever works best for your site.
Also a Meta tag of 'rating' with 'general' let's Net Filtering software know your site is safe for viewers of all ages (as long as it is, of course!)
I also use..
<link rel="start" href="/" title="Home" />
to let the browser know where the home of my site is. And for any browser prefetching systems, though I believe these are yet to be implemented by browsers without assistance of plugins.
Also consider the 'next' and 'prev' <link rel=""> if your pages are in a sequence of sorts.
First, make sure the < !DOCTYPE is the verry first element of the document, i.e. no space, tab or corrupted BOM marker.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- declare all page rendering and programmatic related tags -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- Care about IE ? -->
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<!-- globalise scripting and styling content language -->
<meta name="Content-Type-Script" content="text/javascript" />
<meta name="Content-Type-Style" content="text/css" />
<!-- title tag is MANDATORY -->
<title>Short and relevant, about 64 characters/spaces</title>
<!-- declare all CACHE controll -->
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
<meta name="revisit-after" content="7 days" />
<!-- declare all content description tags -->
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.gcf.org/v2.5" labels on "1994.11.05T08:15-0500" until "1995.12.31T23:59-0000" for "http://w3.org/PICS/Overview.html" ratings (suds 0.5 density 0 color/hue 1))'>
<!-- language specific keywords -->
<meta name="keywords" lang="en-us" content="vacation, Greece, sunshine" />
<!-- For french example -->
<meta name="keywords" lang="fr" content="vacances, Grèce, soleil" />
<meta name="description" content="about 255 characters/spaces WORDS relevant to the content of the actual page" />
<meta name="Abstract" content="about 96 characters/spaces PARAGRAPH describing the actual page content within your site" />
<!-- declare all situationnal and external relativity related tags -->
<link rel="DC.identifier" type="text/plain" href="http://www.ietf.org/rfc/rfc1866.txt" />
<link rel="start" href="/" title="Home" />
<link rel="prev" href="../" title="Parent section" />
<!-- declare all page rendering cascading style sheets in order of incidence -->
<link rel="stylesheet" type="text/css" href="globaly-used.css" />
<link rel="stylesheet" type="text/css" href="specificly-used.css" />
<!-- declare all page rendering specific cascading style i.e. IE only, hacks etc -->
<link rel="stylesheet" type="text/css" href="more-specificly-used.css" />
<link rel="stylesheet" type="text/css" href="i-love-ie.css" />
<!-- not relevent to subject, declare all javascripts AFTER css linking -->
</head>
<body>
</body>
</html>
I didn't see this mentioned: the <base> tag, if specified, should be the first element in <head>. (The base URI of the document is assumed to be . before/if not specified.)
IMHO, the two most important child tags of <head> are <title> and the Content Type meta tag. Search engines actively look at <title>. Whereas the other meta tags are often ignored. As a multi-lingual web user - I cannot stress more the importance of adding the Content Type tag because without it, the browser needs to autodetect the character set of the web page and this operation is often flaky. The result ends up being that various characters are not rendered correctly to the user or sometimes none at all in the case of Japanese or Chinese.
Here is an snippet of some of the header code from a current project of mine:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Reports Blah Blah</title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
...
</head>
There is a related question here that may help add some light regarding the order of the tags.
Generally my pages include the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>...</title>
<meta name="Description" ...>
<meta name="Keywords" ...>
<meta name="Copyright" ...>
<meta name="Author" ...>
<meta name="Language" ...>
<style type="text/css" ...>
DocType is important to enforce strict rendering (No quirks mode) by the browser. You may want to use XHTML instead - as long as there is one there. I add Copyright and Author purely because I design and create the pages for other companies. Description is for SEO, and Language is for the browser (if it supports it).
I don't believe it makes to much of a difference which meta tag comes first, or whether the title should be above. What counts in most cases is that it exists on the page, and has the correct content.
As far as I'm aware, most search engines ignore any "keywords" or "description" meta tags, instead preferring to read the content of the document.
Getting the page title right however, is of extreme importance.
Title, meta tags for keywords, content-type (if not explicitly set by the web server), and any CSS to be applied to the page.
Declaring the CSS up front allows the browser to lay out the page more efficiently (see http://developer.yahoo.com/performance/rules.html#css_top).
I would add an important note: if you're using IE's meta X-UA-Compatible tag to switch rendering modes for Interet Explorer, you must insert it as the first item in HEAD:
<head>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>Page title</title>
...etc
&lt/head>
In addition to the answers above I use the Dublin Core initiative meta-tags.
They are very useful for actual content/papers etc.
<meta name="DC.abstract" content="Document abstract" />
<meta name="DC.audience" content="Target audience" />
etc.