Re: Safari inadequate?



In article <0062f304$0$14668$c3e8da3@xxxxxxxxxxxxxxxxx>,
JF Mezei <jfmezei.spamnot@xxxxxxxxxxxxx> wrote:

Eric Lindsay wrote:

If coming from a web server, the web server gets final say, so you do
not need the meta.

The meta http_equiv tags are meant to override the HTTP header coming
from the web server.

HTTP protocol ([RFC2616], section 3.7.1) mentions ISO-8859-1 as a
default character encoding when the "charset" parameter is absent from
the "Content-Type" header field. However how does a user agent know
which character encoding has been used? The server should provide this
information.

This discussion http://www.w3.org/International/O-charset by Bert Bos is
why I use a http_equiv tag in HTML. I also set it to ISO 8859-1, which
is allowed under Unicode (I think correct UTF-8 is tricky).

The meta charset declaration should always be used for HTML or XHTML
served as HTML. It should never be used for XHTML served as XML.
http://www.w3.org/International/tutorials/tutorial-char-enc/
(the XML declaration is the correct thing to use).

The HTTP header information has the highest priority in case of conflict.
1. HTTP Content-Type
2. XML declaration
3. meta charset declaration
4. link charset attribute

If you are worried about the undesirable effects of an XML charset
declaration with some user agents, the best solution is to omit the
declaration but serve the file as UTF-8 or UTF-16. UTF-8 is the server
default with XHTML.

So I could put an XML declaration in my (static) XHTML files, but if I
ever had to serve them as HTML (say someone persuaded me I had to have
them work with Internet Explorer), then the presence of the XML
declaration would kick some versions of IE into Quirks mode, not the
Standards mode I declare.

That system works well for me in Chrome, Firefox, Opera and Safari. As I
said, IE does not display correctly served XHTML at all, but that
eliminates working around all the other Internet Explorer bugs. If an IE
user downloads it, my files are still valid XHTML and IE will probably
use its error routines to display the downloaded file as plain HTML
(without its CSS). I am not sure how well that would go, as I do not
have IE.

--
http://www.ericlindsay.com
.



Relevant Pages


Loading