W3C home > Mailing lists > Public > www-validator@w3.org > March 2005

Re: Character Encoding mismatch

From: Ronny Vårdal <ting@runbox.no>
Date: Wed, 02 Mar 2005 22:00:43 +0100
Message-ID: <4226297B.2000009@runbox.no>
To: www-validator@w3.org

David Dorward skrev:
> On Wed, Feb 23, 2005 at 02:05:14PM +0700, Daniel Germer wrote:
> 
>>Where is it possible to change the HTTP header???
> 
> 
> That depends on your HTTP server. You almost certainly cannot change
> it from within the document (although a web server which extracts the
> character encoding from meta data in the document is theoretically
> possible, I don't believe one exists).
> 

With Apache, I've managed to override the server headers by sending 
header with PHP.

Afaik. <meta> has lower priority than server headers that has lower 
priority than forced headers from example PHP.

So..

<?php header("Content-Type: text/plain; charset=utf-8"); ?>
as the first line in document, will override whatever the server sets...

Making trough XML you could use this to set "Content-Type: 
application/xml+xhtml; charset=utf-8", and really confuse IE out of 
proportions ;-)



-- 

Ronny Vårdal

NORID Handle: RV138P-NORID
Email:        ting@runbox.no
Web:          http://my.floppy.no
GPG:          0x3B12B97E

"Do not follow where the path may lead.
  Go instead where there is no path and leave a trail."
                                  (George Bernard Shaw)
Received on Wednesday, 2 March 2005 21:28:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:18 GMT