On Sun, August 13, 2006 1:43 pm, Rasmus Lerdorf wrote: > tedd wrote: >> At 6:48 PM -0700 8/12/06, Rasmus Lerdorf wrote: >>> By the way, everyone should be setting a charset. If you don't set >>> it, IE will look at the first 4k of the body of the page and take a >>> wild guess. >>> >>> -Rasmus >> >> -Rasmus: >> >> Ok, but why doesn't w3c use it? >> >> http://validator.w3.org (check source) >> >> I'm not sure what to do re charset. I've been told by credible >> sources >> to "always use it" and "never use it" -- which is correct? Or, is >> this >> one of those "it depends" things? > > W3C is all about standards. IE is all about not following standards. > If you want your site to work in the real world you should always set > a > charset. If you set it in your response header there is no need to > set > it in each page, and if you look closely, you will see that this is > what > w3.org is doing: > > 9:55am shiny:~> telnet validator.w3.org 80 > Trying 133.27.228.132... > Connected to validator.w3.org. > Escape character is '^]'. > HEAD / HTTP/1.0 > > HTTP/1.1 200 OK > Date: Sun, 13 Aug 2006 18:42:15 GMT > Server: Apache/2.0.54 (Debian GNU/Linux) mod_perl/1.999.21 Perl/v5.8.4 > Accept-Ranges: bytes > Connection: close > Content-Type: text/html; charset=utf-8 If you want it to actually WORK in IE, you need both header() and META tag... At least in my limited testing so far under UTF-8 and Transition DOCTYPE. YMMV This is no guarantee that IE will work under any other DOCTYPEs, nor in any other versions of IE. Only that I know that's what it took for the current version of IE I was using a month or two ago. It would be interesting if somebody who understood charsets MUCH better than I were to test all the combinations of: IE version X header/meta charset X many charsets and see just how many of them actually work, and how many of them open up IE to XSS attacks... What a mess MS makes of things! -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php