1Fermer3
squale92Le 25/09/2008 à 06:33
Zephyr (./1) :
Est-ce que vous connaissez la raison qui justifie ce comportement ? Puisqu'il se retrouve dans tous les navigateurs que j'ai testés, je suppose qu'il est standard

ça a l'air d'être le comportement défini par la RFC HTTP/1.1 :
http://www.w3.org/Protocols/rfc2068/rfc2068.txt
Si tu vas à la section "7.2.1 Type", elle dit :
7.2.1 Type

When an entity-body is included with a message, the data type of that
body is determined via the header fields Content-Type and Content-
Encoding. These define a two-layer, ordered encoding model:

entity-body := Content-Encoding( Content-Type( data ) )

Content-Type specifies the media type of the underlying data.
Content-Encoding may be used to indicate any additional content
codings applied to the data, usually for the purpose of data
compression, that are a property of the requested resource. There is
no default encoding.

Any HTTP/1.1 message containing an entity-body SHOULD include a
Content-Type header field defining the media type of that body. If
and only if the media type is not given by a Content-Type field, the
recipient MAY attempt to guess the media type via inspection of its
content
and/or the name extension(s) of the URL used to identify the
resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".


Et la RFC HTML (je cite la RFC HTML 4.0 ; j'imagine que c'est resté pareil dans la RFC XHTML) dit :
http://www.w3.org/TR/REC-html40/charset.html#h-5.2.2
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.
In addition to this list of priorities, the user agent may use heuristics and user settings.


Donc, il semble effectivement s'agir du comportement standard.
Pour ce qui est de la raison "logique", après...