ISO-3166 standard defining 2 and 3 character identifiers for each country in the world.
Questions tagged [country-codes]
326 questions
266
votes
34 answers
Getting visitors country from their IP
I want to get visitors country via their IP... Right now I'm using this (http://api.hostip.info/country.php?ip=...... )
Here is my code:

Alex C.
- 4,021
- 4
- 21
- 24
96
votes
15 answers
Is there an open source java enum of ISO 3166-1 country codes
Does anyone know of a freely available java 1.5 package that provides a list of ISO 3166-1 country codes as a enum or EnumMap? Specifically I need the "ISO 3166-1-alpha-2 code elements", i.e. the 2 character country code like "us", "uk", "de", etc.…

Jason Jenkins
- 961
- 1
- 7
- 4
69
votes
4 answers
Csv list of country codes/names?
Where can I get a list of easily parseable country codes and names? Note: 2 letter codes wanted. Examples:
au,Australia
uk,United Kingdom
us,United States
etc

Ali
- 261,656
- 265
- 575
- 769
67
votes
1 answer
Is there a good flag icon pack that corresponds to ISO-3166 Country Codes?
I'm in need of an icon pack containing flags that correspond with ISO-3166 country codes such as US, CA, SE, DE etc. Optimally the flag icons would have names such as us.png, ca.png and so on. I'm guessing this is a common developer necessity making…

Hubro
- 56,214
- 69
- 228
- 381
57
votes
11 answers
How to convert country names to ISO 3166-1 alpha-2 values, using python
I have a list of countries like:
countries=['American Samoa', 'Canada', 'France'...]
I want to convert them like this:
countries=['AS', 'CA', 'FR'...]
Is there any module or any way to convert them?

MHS
- 2,260
- 11
- 31
- 45
57
votes
8 answers
How can I get the country (or its ISO code)?
What is the best way to get the country code?
As of now, I know two ways. One is to get by TelephonyManager and another by Locale. Which is another best and unique way to find the country code on Android? To be more specific if TelephonyManager is…

Vishal Pawar
- 4,324
- 4
- 28
- 54
52
votes
12 answers
ISO2 country code from country name
Is there an easy way in Java to get the ISO2 code from a given country name, for example "CH" when given "Switzerland"?
The only solution I can think of at the moment is to save all the country codes and names in an array and iterate over it. Any…

Chris
- 1,316
- 2
- 13
- 20
46
votes
10 answers
List of phone number country codes
On this Wikipedia entry I found out that ITU Telecommunication Standardization Sector (ITU-T) is providing such list of country calling codes.
Here is a pdf: http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.164D-2009-PDF-E.pdf
I wonder where to find…

jesperlind
- 2,092
- 2
- 20
- 22
44
votes
3 answers
Get visitors language & country code with javascript (client-side)
Question: Is there a javascript (client-side) code to get visitors country/language code, that is accurate and is cross-"modern"-browser ? I am looking for results like 'en-US', 'sv-SE', 'nl-NL', etc.
Related questions to this have been asked before…

Sergio
- 28,539
- 11
- 85
- 132
37
votes
8 answers
How do you detect a website visitor's country (Specifically, US or not)?
I need to show different links for US and non-US visitors to my site. This is for convenience only, so I am not looking for a super-high degree of accuracy, and security or spoofing are not a concern.
I know there are geotargeting services and…

David Smith
- 38,044
- 11
- 44
- 61
29
votes
2 answers
Netherlands Antilles dissolved as per 10-10-10, how to change Country dropdowns?
See also Dissolution of the Netherlands Antilles.
In a nutshell: Curaçao and Sint Maarten become autonomous and the remnant of the islands (the BES islands) become special municipalities of the Netherlands.
The question is: how should we replace…

BalusC
- 1,082,665
- 372
- 3,610
- 3,555
24
votes
9 answers
Get country code from country name in IOS
Im retrieving a country name from a server in english. For example, "Spain"
What I want to do is, assuming the country name is going to be written in english, get the country code.
What should I do? I´ve found getting the country name from the…

pdrcabrod
- 1,467
- 1
- 14
- 22
23
votes
9 answers
Convert country codes
There are several methods on country codes.
I have a list of codes with 3-characters, like on this page:
http://www.fina.org/H2O/index.php?option=com_content&view=category&id=93:asia&Itemid=638&layout=default
Is there a simple way to convert them to…

James
- 42,081
- 53
- 136
- 161
20
votes
3 answers
How to plot historic country data (USSR, East Germany, etc) in GoogleMaps?
I'm building a series of infographics using Fusion Tables to show yearly data for countries, each nation represented by a pin on Google's map, the data values visible when you click on the nation's pin. I've got the contemporary values working…

TrevorBrown
- 201
- 1
- 4
19
votes
11 answers
Device Country in Flutter
I am trying to get country of device (Android) in Flutter. I used this tutorial, but I think it is the wrong approach for my problem.
Locale myLocale = Localizations.localeOf(context);
print(myLocale.languageCode.toString() + ' ' +…

Aleem
- 520
- 1
- 4
- 15