Re: HTTP header. Invalidity of setting charset in html.

On Wed, 15 Sep 2004, Michael Talbot-Wilson wrote:

> Can anyone explain the rationale for the charset specified by the http
> header over-riding that in the document during validation (and
> browsing).

Such processing is mandated in the HTML specifications.

If you wish to raise the issue, then the suitable forum is thus one that
discusses those specifications, such as the HTML mailing list of the W3C.
_Not_ a list that discusses a markup validator, still less a list that
discusses a style sheet checker.

> It would seem reasonable for the document to override the
> server setting.  Otherwise there seems no point, it is logically
> invalid, to specify the charset in the xml declaration and html
> header.

No, it is not logically invalid or incorrect to specify redundant
information. It is illogical, though not formally incorrect, to specify an
encoding that differs from the one specified in HTTP headers.

Specifying the encoding in a <meta> tag is useful, for example, for
working with a document locally, on the user's disk, and for submitting a
document to validation or other checking via file input, in case the
browser does not include charset information in the MIME headers.

> "Character encoding mismatch!  The character coding specified in the
> HTTP header (iso-8859-1) is different from the value in the XML
> declaration (utf-8).  I will use the value in the HTTP header
> (iso-8859-1)."

Well that's a serious problem indeed, so isn't it useful that a validator
reports it? Or if it's a wrong report, we would need to know exactly when
it appears.

> And, incidentally, I've been unable to discover in the source, the
> config file or the docs how to set the charset in the header.

We have even fewer possibilities of locating the problem, since we don't
even know the URL, or other method that you used to submit a document to
validation or other checking.

It is possible that you have encountered a bug where some validator or
other checker gets a wrong idea of HTTP headers, but it really doesn't
help to claim that it should not process HTTP headers by the relevant
specifications.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Wednesday, 15 September 2004 10:00:33 UTC