On 07 Oct, John-Mark Bell <jmb202(a)ecs.soton.ac.uk> wrote:
On Fri, 7 Oct 2005, Stefaan Claes wrote:
> On 06 Oct, John-Mark Bell <jmb202(a)ecs.soton.ac.uk> wrote:
>> Oregano 2 and NetSurf send subtly different Accept-Language headers when
>> you select a language:
>> Oregano 2: Accept-Language: nl
>> NetSurf : Accept-Language: nl, *;q=0.1
> > What this means is that NetSurf asks for Dutch pages, but is quite
> > happy to receive anything else (providing that there's no Dutch page
> > available). O2 asks for Dutch pages and refuses to accept anything
> > else.
I found out it is possible to set the same accept-language (nl, *;q=0.1) in
Oregano2 and with this settings Oregano also fetches German and French
webpages (as NS did). (cf. <http://netsurf.sourceforge.net/>
> Is the quality value really necessary here? If the order in
> languages are listed is important, then I would expect it to have the
> same effect as Accept-Language: nl, * (where both languages have the
> same (default) quality value of 1)
> Is this correct ?
The server will attempt to serve the language with the highest
can't recall off-hand what method should be used for determining which
language to choose out of a group of languages with the same quality.
The order in which they appear? If I set the accept-language to 'nl, fr, en'
then I get the French version of the netsurf webpage. If I change it to
'nl, en, fr' then I get the English webpage.
>> I think the correct solution would be to remove the *;q=0.1
>> the header that NetSurf sends.
> Is the '*;q=0.1' always added?
At present, yes.
Oops, I could have checked this easily by reading a php variable...
>> Until NetSurf gains useful support for selecting more than
>> for web pages, there's not much point in removing this as it would just
>> make the situation worse.
> Sorry, but I don't grok this. If it is possible to add more than one
> language in the choices file (accept-language: line), then I would assume
> NS already has support for selecting more than one language.
Only in that the fetch code simply copies the contents of the option
directly into the Accept-Language header. The UI has no knowledge of this,
hence the warning about not changing the option from the choices dialogue.
I'd rather not remove the *;q=0.1 until the UI supports selecting more
than one language (especially as hacking around in the Choices file
manually isn't the nicest thing in the world).
> And I don't see why removing the '*;q=0.1' would
make the situation
> worse. I think I'm missing the point completely. :-/
Well, in the case above, by removing the *;q=0.1 entry, you'd get
errors for any site which can't supply a Dutch language page (which can
hardly be described as useful behaviour ;)
Good point. But I have never seen a 406 yet... (see below)
>> There is a workaround, however. Find the accept_language
entry in the
>> Choices file and modify it to something like:
>> nl, en;q=0.5
> Merci beaucoup, ça marche. ;-)
> The quality value isn't necessary. It works as long as English (en) is
> in the list of languages (e.g. accept-language: nl, en)
Well, it is necessary but only in that the quality is higher than 0.1
(otherwise the server will start attempting to serve up random pages ;)
I tried this with an accept-language of 'nl, *;q=0.001' (O2) and I didn't
get random pages, just the same page as with 'nl, *;q=0.1'.
> BTW: I read rfc2616 (1) and I still wonder what should happen if
> webpage is only available in those languages which are not acceptable to
> the user: e.g. accept-language: nl, fr;q=0, de;q=0, en;q=0 I would expect
> to get a 406 Not Acceptable, but instead I get the webpage in English.
> It's not that important, but is this a web server bug^Wfeature?
In the general case, yes, you can expect a 406 response. In the case
the NetSurf site, we've got a PHP script which traps 406 responses and
sends the English page instead. This was implemented as a workaround for
IE being naff and replacing Apache's useful list of available languages
with a (not so) "friendly" error page. As it happens, O2 would probably
exhibit the same behaviour (without the error page, just an O2 style
error box saying it couldn't fetch the page due to some unspecified HTTP
Is trapping the 406 responses something that's done by most websites? With
an 'accept-language: nl' I tried several websites that are not available in
Dutch and I never got a 406...
Or are they just ignoring the accept-language header field?
Stefaan Claes, Hove, Antwerpen, Belgium, Europe, <sclaes(a)riscosusers.be>