Re: XHTML 1.0 Content-Negotiation

* 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 UTC