W3C home > Mailing lists > Public > www-qa@w3.org > August 2005

Re: XHTML 1.0 Content-Negotiation

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sat, 06 Aug 2005 23:02:52 +0200
To: "Jim Ley" <jim@jibbering.com>
Cc: "James Pickering" <jp29@cox.net>, <www-qa@w3.org>
Message-ID: <42f6238f.1972609@smtp.bjoern.hoehrmann.de>

* Jim Ley wrote:
>Unfortunately this is incorrect, and would violate HTTP 1.1, the Accept 
>header is considerably richer in what it can say than the above uses.

Indeed, another typically overlooked case are escape sequences in quoted
strings, for example, Content-Type:text/html;charset="\utf-8" is often
not parsed correctly. The encoding_from_content_type method in my 
http://search.cpan.org/src/BJOERN/HTML-Encoding-0.52/lib/HTML/Encoding.pm
gets it right, it's based on on HTTP::Header::Util::split_header_words
http://search.cpan.org/src/GAAS/libwww-perl-5.803/lib/HTTP/Headers/Util.pm
neither of which are trivial functions. The Perl module HTTP::Negotiate
http://search.cpan.org/perldoc?HTTP::Negotiate should provide a better
facility here. I gather something similar is available for PHP. Please
don't rely on non-standard code for improved standards-compliance.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Saturday, 6 August 2005 21:03:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 12:14:01 GMT