Lachlan Hunt wrote:
[color=blue]
> Arne wrote:
>[color=green]
>>But I have also noticed that I don't realy need the tag with
>>"Content-Type" and "charset" when I have the <?xml version="1.0"
>>encoding="utf-8"?> in top of the page to get valid pages, and it works
>>fine in IE 6 but I don't know about other browsers and versions?[/color]
>
>
> Not if your serving the document as text/html. In such cases, the
> document is parsed as HTML/tag-soup, not XML, so the <?xml?> PI is
> ignored, but it also sends IE into quirks mode, which can produce
> different results, depending on what your using, and the differences
> between IE's quirks and more quirks (oops... I mean “standards
> compliant”) modes :). Also, note that Appendix C [1] of the XHTML 1.0
> spec recommends omitting the <?xml?> PI for compatibility with legacy
> user agents.
>
> Also, if you have the ability to do so, you should configure your
> server to send the charset in the Content-Type HTTP header. At the
> moment, it's only sending:
>
> Content-Type: text/html
>
> but it should be sending something like:
>
> Content-Type: text/html; charset=utf-8
> (after you correctly save your document as utf-8)
>
> You should be able to configure that through a .htaccess file, if
> your host allows. If that is done correctly, then you don't need to
> declare it in the <meta/> tag, but note that if your going to send the
> document as X(HT)ML, then you shouldn't include the charset in the
> Content-Type header [2]. eg.
>
> Content-Type: application/xhtml+xml
>
> and then you should either include the <?xml?> PI to declare the
> charset, or you can only use UTF-8 or UTF-16 because they are the defaults.
>
> [1]
http://www.w3.org/TR/xhtml1/#C_1
>
> (This is only a draft, but it's still got some good advice in it)
> [2]
http://www.w3.org/TR/2004/WD-webarch...05/#no-charset
>[/color]
Thank's a lot for the tip's, I will save them for future reading :-)
I have a new test page (
http://w1.978.telia.com/~u97802964/test2.html)
Different content but still for same purpose. I can't do the .htaccess
for the test file, as it is on my ISP's server, but will be useful on
domain hosts.
I noticed after more testing with IE that it's very buggy changing
encoding if I don't have the META with "Content-Type" and "charset" on
the file (was forced to change manualy) so I put it back on the new
test page. I have also tried to omit the the <?xml?> PI and it still
works and validate. But as I am only testing and learning, I leave it
on the test page.
I have done a lot of HTML, and get interested in learning XHTML and
XML as it can be useful in the future. :-)
About the rendering mode, it's easy to see in Mozilla if a page is
rendering as standard or quirks mode just by looking at the "view page
info". But it's not possible to see how IE is rendering the same page?
Thank's again for your input!
--
/Arne