Forum Moderators: open

Message Too Old, No Replies

Proper use of http-equiv

Charset meta tag

         

skp77

12:25 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



Hi,

I was wondering if html/htm file do not have the http-equiv meta tag. Which one is best suitable for the webpage ur editing.

In some of my previous work, this one was automatically in there, as i used dreamweaver.

Now that i am editing another persons code who used frontpage or another tool. They never placed the http-equiv line.

I have done google search on the meta tag, and found on different variations of it.

Can anyone provide a basic outline of it and if using the line below is fine for a html website.

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

JAB Creations

3:27 pm on Jul 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For XHTML these validate fine...

<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="imagetoolbar" content="no" />

pageoneresults

3:35 pm on Jul 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The global structure of an HTML document - The META element [w3.org]

META and HTTP headers
The http-equiv attribute can be used in place of the name attribute and has a special significance when documents are retrieved via the Hypertext Transfer Protocol (HTTP). HTTP servers may use the property name specified by the http-equiv attribute to create an [RFC822]-style header in the HTTP response. Please see the HTTP specification ([RFC2616]) for details on valid HTTP headers.

Your example is the correct syntax for the charset metadata...

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

encyclo

6:06 pm on Jul 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums, skp77. As pageoneresults has said you have the syntax correct. However choosing the right character encoding depends on which language you are using for your content. The example you gave (ISO-8859-1) is perfect for most western European languages including English. If you are using an East European language (eg. Russian), Arabic or Japanese, for example, the alphabets are different and the character encoding is too.

Another option is to use UTF-8, which is a newer encoding which covers almost all modern languages.

skp77

12:09 am on Jul 15, 2005 (gmt 0)

10+ Year Member



Hi,

thanks for the replies all,

appreciate the pointers and am certainly clear on the topic now. have clear idea which ones to use in the right spot.

cheers,
sanjay-skp77