httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ICS.UCI.EDU>
Subject Re: [BUG] mod_neg charset bug and update
Date Fri, 07 Mar 1997 17:33:10 GMT
>However the implicit use of q=1.0 for iso-8859-1 means that in order for
>a UA to say it does not want iso-8859-1 it has to, for example, send
>
>  Accept-Charset: wibble; q=0.2, flan; q=0.7, iso-8859-q; q=0.01
>
>In the current code the q value for iso-8859-1 is ignored, and iso-8859-1
>variants always get q=1.0. This is a bug which makes means Apache does
>not honour the q value for iso-8859-1 in the second example.
>
>The attached patch fixes this.

That part is good.

>While I was doing this I also considered the situation where you have some
>variants with have a charset and some which don't. Currently those which
>don't are given a q=1.0. Thus a variant with no charset would be preferred
>on the above example Accept-Charset header. There are three ways to handle
>over variants with charsets which are listed variants with no character
>set assigned: 
>
>   1  As at present, give variant a charset q=1.0
>   2  Assume variant is iso-8859-1 and give it the q of iso-8859-1 from
>      the Accept-Charset header, or 1.0 if not present
>   3  Give variant a low priority
>
>The second option initially seems the best, but I don't want to build an
>assumption about what character documents are in into Apache. It is the
>logical equivalent of saying "if a variant has no language, assume it is
>English". Given the international nature of Apache and the web, I don't
>think we should make any assumptions about the character set in use on the
>server. 
>
>That leaves option 3. This is coded in the enclosed patch.

Sorry, the right answer is 2.  No charset parameter means iso-8859-1,
because that is what it has always meant in HTTP.  In order to use a
different charset, it must be provided explicitly.

I imagine the best fix would be something like

    if (!*charset) {            /* variant has no charset */
        *charset = "iso-8859-1";
    }

but I'm a little too tired to remember if that is legit C or not.

.....Roy

Mime
View raw message