From: Alexios Z. <zv...@po...> - 2006-01-25 14:55:40
|
Wojciech Kocjan wrote [edited]: > Dnia 25-01-2006 o 13:05:40 David Gravereaux <dav...@po...> napisa?: > >What happens when the server sets > > "Content-Type: text/html; charset=XXX" > >in the headers and the page contains: > > <meta http-equiv="Content-Type" content="text/html; charset=YYY"> > >Does the <meta> win or is it done twice, once for the transmission, and > >second at html parser level? > > From what I know http wins, meta is chosen when http does not specify it. > But I'm not sure if it's standarized in any way so that you can actually > rely on this. That's correct -- and it *is* standardized. From section 5.2.2 of the html spec: ---------------------------------------------------------------------- To sum up, conforming user agents must observe the following priorities when determining a document's character encoding (from highest priority to lowest): - An HTTP "charset" parameter in a "Content-Type" field. - A META declaration with "http-equiv" set to "Content-Type" and a value set for "charset". - The charset attribute set on an element that designates an external resource. ---------------------------------------------------------------------- http://www.w3.org/TR/REC-html40/charset.html#doc-char-set -- -- zvr -- -- +---------------------------+ Alexios Zavras (-zvr-) | H eytyxia den exei enoxes | zv...@po... +-----------------------zvr-+ |