W3C home > Mailing lists > Public > www-validator@w3.org > July 2004

Re: Doctype problem

From: David Dorward <david@dorward.me.uk>
Date: Fri, 16 Jul 2004 15:03:15 +0100
Message-Id: <E20554AF-D730-11D8-8D77-000A957E4F00@dorward.me.uk>
Cc: www-validator@w3.org
To: "Magician Felix" <felixcardmagic@hotmail.com>

On 16 Jul 2004, at 14:43, Magician Felix wrote:
> I have a question about doctypes, when I put the following in the 
> beginning of html code:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> the page loads just fine. BUT when I add this 
> "http://www.w3.org/TR/html4/loose.dtd">

When you add the URI to that Doctype the browser you are testing in 
switches to "Standards mode, stops emulating bugs in earlier versions 
of that browser, and pays more attention to the standards (e.g. 
ignoring lengths lacking units).


> Which one is the "correct", pure HTML code - with or without that last 
> part?

Both are correct. The latter is more useful as it doesn't require any 
SGML parser to recognize the public identifier.

>  Also, I've seen the last part written in different ways, for example 
> "http://www.w3.org/TR/html401/loose.dtd" instead of 
> "http://www.w3.org/TR/html4/loose.dtd". Which one is correct?

They both point to the same file.

> Also, I tried HTML validator and it complains about my charset 
> encoding, I figured it didn't like the "euro" signs on my page. I 
> think I should use the ISO-charset encoding?

There are over a dozen ISO character sets. The Euro sign appears is 

>  How can I set that in my html code

The correct place to set it is the http headers the server sends before 
the document (and those headers should represent the character encoding 
you saved the document in, not a random character encoding which 
happens to have the characters you are using in it). This should be 
explained (with lots of links) by any error message the validator 
produces in relation to character sets.

> and will that cause problem in foreign users' browsers?

Not setting it is more likely to cause such problems. Their browsers 
will have to use their default character encoding.

David Dorward
Received on Friday, 16 July 2004 10:03:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:58:43 UTC