PDA

View Full Version : Meta charset


Reno
14-07-2002, 15:16/03:16PM
I have run into some confusion over which of these configurations is actually correct (for sites in USA):

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

or

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

or

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


I believe it is door #1, but want to confirm...

potato
14-07-2002, 17:27/05:27PM
the correct syntax is
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

for more info on this stuff, see
http://www.w3.org/TR/REC-html40/charset.html#h-5.1
or (for an in-depth look)
http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.4

if you are coding in iso-8859-1 and if the users browser recognizes the tag, it increases the chance that text chars are displayed like you typed them in. Browsers settings may though override the tag. If you use foreign (non-US) letters then think about using the utf-8 charset. Otherwise, just forget. Most current browsers have iso-8859-1 as their default setting.

ihelpyou
14-07-2002, 17:56/05:56PM
Welcome to the forums potato! :hi:

Thanks for the good info and post!

Reno
14-07-2002, 18:09/06:09PM
Thanks potato for the informative answer, and for the links. I had assumed that the first choice was the correct one, but then someone told me that "you always have to use 'name' with meta", so I had momentary confusion.

Glad to have it cleared up....

ihelpyou
14-07-2002, 18:27/06:27PM
Welcome to the forums to you as well Reno! :hi:

Did not mean to leave you out. :D

g1smd
06-10-2002, 08:59/08:59AM
I use:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

but have also started to add:

<META HTTP-EQUIV="Content-Language" CONTENT="EN-GB">

The Character Set tells the browser which one to use. The Content Language tag is going to become more important in search engines in the future.

They also help with online translation tools, and help visitors to your web site that use other settings as their default.