Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a centralized list of country names that can be used for web drop down boxes (and validation) [closed]

Tags:

html

forms

There are examples online with web select boxes that have a huge list of countries and that probably will be good enough for me to use. However, by Murphy's law, there's bound to be some random country that someone is from and isn't on my list (and probably someone else also ran into this and has updated their local list). Also, when new countries are added, I won't know about it.

Basically, I feel it's better practice and a better smell if there is some centralized list of country names that I can use / trust. (also it could set/follow standards for exact namings "United St..." vs "USA" etc.)

I would prefer a solution that isn't IIS specific if possible

like image 347
Alexander Bird Avatar asked Dec 02 '08 00:12

Alexander Bird


3 Answers

There are many list of countries, check this wikipedia article; there you can find some lists like:

  • ISO 3166-1 countries codes
  • IOC country codes
  • Alternative country names

And more...

like image 82
Christian C. Salvadó Avatar answered Nov 06 '22 01:11

Christian C. Salvadó


We maintain a list of 'PUBLIC DOMAIN' Worldwide Country names in all official formats. The information comes from the ISO 3166-1 Maintenance Agency for offical English and French short names, the US Board on Geographic Names (BGN) for english short, long and local short, long names, and United Nations Group of Experts on Geographic Names (UNGEGN) format (long) English, French names, short and formal local names and Spanish names.

There still is a problem representing some Arabic characters as romanized characters (will see ?). But these are limited to the local names of a few Arab countries.

Note, the English, Spanish and French cover the 3 Western languages of the UN's official 6 languages. Metadata, information on the sources, and download can be found at:

http://www.opengeocode.org/download.php#countrynames

The Open Geocode Team OpenGeoCode.org

Jan. 26, 2014. We updated the list to include country names in Italian and German. We used the UN Food & Agriculture list of countries in Italian and the German Government's Federal Foreign Office's list of countries in German.

like image 27
Andrew - OpenGeoCode Avatar answered Nov 06 '22 02:11

Andrew - OpenGeoCode


I recommend pulling data out of the Unicode CLDR (Common Locale Data Repository), which include a professionally-maintained list of countries and country name data.

Grab the data from there once, and do updates once in a while; the CLDR data will come in a consistent format, so you won't need to fuss over it once it's part of your workflow.

like image 3
Anirvan Avatar answered Nov 06 '22 03:11

Anirvan