How about ISO-3166-2?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

How about ISO-3166-2?

Post by visonardo »

How about ISO-3166-2 ?

Im from argentina and for example i found http://en.wikipedia.org/wiki/ISO_3166-2:AR

but, really the users agent give this info? , because my explorer (mozilla) just give es-ar

this is the header that gives my explorer

Code: Select all

[Accept-Language] => es-ar,es;q=0.8,en-us;q=0.5,en;q=0.3

then, how can i use those codes? to determinate exactly where are they come from :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You can't use it to determine where they are from. What you can do with that information is understand what language their browser natively is built for and deduce from that what language(s) the visitor understands. In this case, Argentinian Spanish.
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

Post by visonardo »

ok, but for example to Argentina´s salta province the code say that is AR-A. when/where or for what i must use this code? or ist useful? :?:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: How about ISO-3166-2?

Post by volka »

visonardo wrote:but, really the users agent give this info? , because my explorer (mozilla) just give es-ar

this is the header that gives my explorer

Code: Select all

[Accept-[b]Language[/b]] => es-ar,es;q=0.8,en-us;q=0.5,en;q=0.3
language codes are defined in ISO 639
ISO 3166 is about localisation, not languages.
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

Re: How about ISO-3166-2?

Post by visonardo »

volka wrote:
visonardo wrote:but, really the users agent give this info? , because my explorer (mozilla) just give es-ar

this is the header that gives my explorer

Code: Select all

[Accept-[b]Language[/b]] => es-ar,es;q=0.8,en-us;q=0.5,en;q=0.3
language codes are defined in ISO 639
ISO 3166 is about localisation, not languages.

yes, i knew that; But where is it used? some explorer give this data if you configure very good?. Other thing that perhaps is related with it is that in somesites that you check ip address own, showed medirectly that my ip was from Buenos Aires, how they do that? perhaps is something that give the iso3166-2 codes
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Never heard of a standard browser/client sending ISO 3166 infos within "normal" http requests.
Maybe you find something useful about the usage at http://www.iso.org/iso/en/prods-service ... 166-2.html
I've never came in "direct" contact with this standard. There are other standards that make use of some parts of iso 3166 but they are standards on their own, add codes, only use a subset etc.
I found http://www.idude.net/I18N/articles/web_ ... o_3166.asp via google
I am simply amazed by the fact that the following options appear in country select boxes on many websites.
* Bouvet Island
* Heard & McDonald islands
Why? Because they are uninhabited.
and now I'm interested ;)

There are databases that try to link ip addresses to regions. Results might be accurate, might be wrong ;)
I only know of geoip but there are certainly other services of this kind.
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

Post by visonardo »

wow 8O

Cool info, Thank you so much by that :o

:D
duk
Forum Contributor
Posts: 199
Joined: Wed May 19, 2004 8:45 am
Location: London

Post by duk »

nice post GeoIP is great :D
Post Reply