Character Sets?

I’ve always used:
meta http-equiv=“Content-Type” content=“text/html;charset=iso-8859-1”

but recently, I came across this:
meta charset=“utf-8”

Is one better than the other please?

The first one is the older version of the declaration; the second is all you need to be valid in HTML5, so it depends which Doctype you use which one you need.

Or are you asking about the different charsets, rather than the different declarations?

Thanks, it would be used with
!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd

Really??

That’s definitely old, so as I said previously, use the older style declaration.

https://www.w3.org/TR/html4/charset.html#h-5.2.2

Hi there Dez,

it’s not 1997, so do not use an HTML 4.01 Transitional DTD. :scream:

Use either an HTML 4.01 Strict DTD or <!DOCTYPE html>.

coothead

3 Likes

Not 1997!!! Darn and glory be, I knew I shouldn’t have bought that cheap diary on fleabay!! :wink:

It’s no biggie for me, but will look into this some more and post back.

Thanks for the input.

This may possibly help you in your forthcoming research…
[color=navy]
“The HTML 4.01 Transitional DTD, includes presentation attributes
and elements
that W3C expects to phase out as support for style
sheets matures. Authors should use the Strict DTD when possible,
but may use the Transitional DTD when support for presentation
attribute and elements is required.”
[/color]

coothead

1 Like

Hi there Dez,

I forgot to mention that the “HTML 4.01 Strict DTD” requires…

<meta http-equiv="content-type" content="text/html; charset=utf-8">

…as opposed to the “<!DOCTYPE html>.” which requires…

<meta charset="utf-8">

coothead

2 Likes

Surely you have removed the HTML 3.2 tags from your page by now. It has after all been 19 years since that was introduced for pages that had yet to finish transitioning to HTML 4.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.