[whatwg] META elements

Anne van Kesteren fora at annevankesteren.nl
Mon Aug 30 07:47:46 PDT 2004


>> I believe that current UAs first look at the HTTP header. If no 
>> 'charset' parameter has been given the document is spidered for the
>> META element. If it has been found the character encoding is taken
>> and the document re rendered with the found character encoding. If
>> no character encoding is found the UA uses some mechanism to find 
>> it or assumes iso-8859-1, the default for 'text/html'. (I can be 
>> wrong here, this is just an indication of something the 
>> specification should tell.)
> 
> Like <http://www.w3.org/TR/REC-html40/charset.html#h-5.2.2> ?

:-)

Now I'm left wondering if the HTML specification contradicts itself or
not...

5.2.2 Specifying the character encoding[1]

# To sum up, conforming user agents must observe the following
# priorities when determining a document's character encoding (from
# highest priority to lowest):
# 1. An HTTP "charset" parameter in a "Content-Type" field.
# 2. A META  declaration with "http-equiv" set to "Content-Type" and a
#    value set for "charset".
# 3. The charset attribute set on an element that designates an external
#    resource.

7.4.4 Meta data, The META element[2], 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.


[1]<http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#h-5.2.2>
[2]<http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#edef-META>


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>




More information about the whatwg mailing list