Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question about Accept-Encoding, Accept-Charset and Accept-Language HTTP Headers sent

517 views
Skip to first unread message

hgiuh ghj

unread,
Aug 16, 2008, 12:58:00 PM8/16/08
to web-develop...@lists.mozilla.org

Hello,

I'm studying he HTTP Headers sent by the Mozilla based browsers, please have a look at theses Headers:

==============================
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fi; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept-Language: fi,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ko; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept-Language: ko-kr,ko;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Charset: EUC-KR,utf-8;q=0.7,*;q=0.7
=============================

I'm trying to find the rule used to build the Accept-Language and Accept-Charset headers. First, I thought the first accept language was the 4 letters locale code, but I don't understand this line: "Accept-Language: fi,en;q=0.5", why it's just "fi" and not "fi-fi" ?

My aim is to build a code able to generate these lines assuming I have the 4 lettes locale code (en-US for instance)

Regards,
David Magnus

_________________________________________________________________
Contrôlez les personnes autorisées à parler à vos enfants sur MSN / Windows Live Messenger !
http://www.windowslive.fr/controleparental/default.asp

Ralph Fox

unread,
Aug 18, 2008, 3:20:45 PM8/18/08
to
On Sat, 16 Aug 2008 16:58:00 +0000, in message <mailman.731.1218906014.44...@lists.mozilla.org>,
hgiuh ghj wrote:

> I'm studying he HTTP Headers sent by the Mozilla based browsers,
> please have a look at theses Headers:

> Accept-Language: en-us,en;q=0.5

> Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3

> Accept-Language: fi,en;q=0.5

> Accept-Language: ko-kr,ko;q=0.8,en-us;q=0.5,en;q=0.3

> I'm trying to find the rule used to build the Accept-Language [...]

> headers. First, I thought the first accept language was the 4 letters
> locale code, but I don't understand this line: "Accept-Language: fi,en;q=0.5",
> why it's just "fi" and not "fi-fi" ?


Get yourself a copy of Firefox 2.0.0.16, and take a look
at the settings which you can configure at

Tools » Options » Advanced » General » Languages, Choose...


--
Cheers,
Ralph

hgiuh ghj

unread,
Aug 20, 2008, 9:20:47 AM8/20/08
to Ralph Fox, web-develop...@lists.mozilla.org

----------------------------------------
> From: -rf-nz-@-.invalid
> Subject: Re: Question about Accept-Encoding, Accept-Charset and Accept-Language HTTP Headers sent
> Date: Tue, 19 Aug 2008 07:20:45 +1200
> To: web-develop...@lists.mozilla.org
>
> On Sat, 16 Aug 2008 16:58:00 +0000, in message ,


> hgiuh ghj wrote:
>
>> I'm studying he HTTP Headers sent by the Mozilla based browsers,
>> please have a look at theses Headers:
>
>> Accept-Language: en-us,en;q=0.5
>
>> Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
>
>> Accept-Language: fi,en;q=0.5
>
>> Accept-Language: ko-kr,ko;q=0.8,en-us;q=0.5,en;q=0.3
>
>> I'm trying to find the rule used to build the Accept-Language [...]
>> headers. First, I thought the first accept language was the 4 letters
>> locale code, but I don't understand this line: "Accept-Language: fi,en;q=0.5",
>> why it's just "fi" and not "fi-fi" ?
>
>
> Get yourself a copy of Firefox 2.0.0.16, and take a look
> at the settings which you can configure at
>
> Tools » Options » Advanced » General » Languages, Choose...

Thank you but that's not the point. I mean: if I change this settings, some languages will be declared as 4 letters local code (en-us, fr-fr, de-de, en-gb), however, some others will be declared as "fi,en" for instance, but not "fi-fi", "de-de", or "fr-fr". I don't understand why the 4 letters locale code of the country (fi-fi for instance) aren't always used ?


Regards
_________________________________________________________________
Plus besoin de clé usb ! Stockez votre musique en ligne gratuitement !
http://www.windowslive.fr/skydrive/

Ralph Fox

unread,
Aug 22, 2008, 7:06:37 AM8/22/08
to
On Wed, 20 Aug 2008 13:20:47 +0000, in message <mailman.1068.1219238519.4...@lists.mozilla.org>,
hgiuh ghj wrote:

> >> I'm trying to find the rule used to build the Accept-Language [...]
> >> headers. First, I thought the first accept language was the 4 letters
> >> locale code, but I don't understand this line: "Accept-Language: fi,en;q=0.5",
> >> why it's just "fi" and not "fi-fi" ?
> >
> >
> > Get yourself a copy of Firefox 2.0.0.16, and take a look
> > at the settings which you can configure at
> >
> > Tools » Options » Advanced » General » Languages, Choose...
>
> Thank you but that's not the point. I mean: if I change this settings,
> some languages will be declared as 4 letters local code (en-us, fr-fr,
> de-de, en-gb), however, some others will be declared as "fi,en" for
> instance, but not "fi-fi", "de-de", or "fr-fr". I don't understand why
> the 4 letters locale code of the country (fi-fi for instance) aren't
> always used ?


It _is_ the point.

When _YOU_ adjust the settings, _YOU_ (not Firefox) choose whether to use
a language code without a country or a language code with a country.
You are the one that chooses between, for instance

en = English
en-us = English/United States
en-gb = English/United Kingdom
en-jm = English/Jamaica

BOTH forms (with and without country) are part of the international
standard language codes. Firefox does not take away _YOUR_ choice
to use one or other form.


I can set mine up like this...

first: en-nz
second: en

...and this would mean: if the website has a 'New Zealand English' version
of the page, give that to me, otherwise give me the website's 'generic'
English version (in preference to, say, French or Bulgarian).


--
Cheers,
Ralph

0 new messages