Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xecgr/dbf00d3ffa4a0ec7d2e7 to your computer and use it in GitHub Desktop.
Save xecgr/dbf00d3ffa4a0ec7d2e7 to your computer and use it in GitHub Desktop.
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function. It completes the English version from https://gist.github.com/maephisto/9228207
//crawled from https://es.wikipedia.org/wiki/ISO_3166-1
isoCountries = {
"AD": "Andorra",
"AE": "Emiratos \u00c1rabes Unidos (los)",
"AF": "Afganist\u00e1n",
"AG": "Antigua y Barbuda",
"AI": "Anguila",
"AL": "Albania",
"AM": "Armenia",
"AO": "Angola",
"AQ": "Ant\u00e1rtida",
"AR": "Argentina",
"AS": "Samoa Americana",
"AT": "Austria",
"AU": "Australia",
"AW": "Aruba",
"AX": "\u00c5land, Islas",
"AZ": "Azerbaiy\u00e1n",
"BA": "Bosnia y Herzegovina",
"BB": "Barbados",
"BD": "Bangladesh",
"BE": "B\u00e9lgica",
"BF": "Burkina Faso",
"BG": "Bulgaria",
"BH": "Bahrein",
"BI": "Burundi",
"BJ": "Benin",
"BL": "Saint Barth\u00e9lemy",
"BM": "Bermudas",
"BN": "Brunei Darussalam",
"BO": "Bolivia (Estado Plurinacional de)",
"BQ": "Bonaire, San Eustaquio y Saba",
"BR": "Brasil",
"BS": "Bahamas (las)",
"BT": "Bhut\u00e1n",
"BV": "Bouvet, Isla",
"BW": "Botswana",
"BY": "Belar\u00fas",
"BZ": "Belice",
"CA": "Canad\u00e1",
"CC": "Cocos / Keeling, (las) Islas",
"CD": "Congo (la Rep\u00fablica Democr\u00e1tica del)",
"CF": "Rep\u00fablica Centroafricana (la)",
"CG": "Congo (el)",
"CH": "Suiza",
"CI": "costa de marfil !C\u00f4te d'Ivoire",
"CK": "Cook, (las) Islas",
"CL": "Chile",
"CM": "Camer\u00fan",
"CN": "China",
"CO": "Colombia",
"CR": "Costa Rica",
"CU": "Cuba",
"CV": "Cabo Verde",
"CW": "Cura\u00e7ao",
"CX": "Navidad, Isla de",
"CY": "Chipre",
"CZ": "Rep\u00fablica Checa (la)",
"DE": "Alemania",
"DJ": "Djibouti",
"DK": "Dinamarca",
"DM": "Dominica",
"DO": "Dominicana, (la) Rep\u00fablica",
"DZ": "Argelia",
"EC": "Ecuador",
"EE": "Estonia",
"EG": "Egipto",
"EH": "Sahara Occidental",
"ER": "Eritrea",
"ES": "Espa\u00f1a",
"ET": "Etiop\u00eda",
"FI": "Finlandia",
"FJ": "Fiji",
"FK": "Malvinas [Falkland], (las) Islas",
"FM": "Micronesia (Estados Federados de)",
"FO": "Feroe, (las) Islas",
"FR": "Francia",
"GA": "Gab\u00f3n",
"GB": "Reino Unido de Gran Breta\u00f1a e Irlanda del Norte (el)",
"GD": "Granada",
"GE": "Georgia",
"GF": "Guayana Francesa",
"GG": "Guernsey",
"GH": "Ghana",
"GI": "Gibraltar",
"GL": "Groenlandia",
"GM": "Gambia (la)",
"GN": "Guinea",
"GP": "Guadeloupe",
"GQ": "Guinea Ecuatorial",
"GR": "Grecia",
"GS": "Georgia del Sur (la) y las Islas Sandwich del Sur",
"GT": "Guatemala",
"GU": "Guam",
"GW": "Guinea Bissau",
"GY": "Guyana",
"HK": "Hong Kong",
"HM": "Heard (Isla) e Islas McDonald",
"HN": "Honduras",
"HR": "Croacia",
"HT": "Hait\u00ed",
"HU": "Hungr\u00eda",
"ID": "Indonesia",
"IE": "Irlanda",
"IL": "Israel",
"IM": "Isla de Man",
"IN": "India",
"IO": "Territorio Brit\u00e1nico del Oc\u00e9ano \u00cdndico (el)",
"IQ": "Iraq",
"IR": "Ir\u00e1n (Rep\u00fablica Isl\u00e1mica de)",
"IS": "Islandia",
"IT": "Italia",
"JE": "Jersey",
"JM": "Jamaica",
"JO": "Jordania",
"JP": "Jap\u00f3n",
"KE": "Kenya",
"KG": "Kirguist\u00e1n",
"KH": "Camboya",
"KI": "Kiribati",
"KM": "Comoras (las)",
"KN": "Saint Kitts y Nevis",
"KP": "Corea (la Rep\u00fablica Popular Democr\u00e1tica de)",
"KR": "Corea (la Rep\u00fablica de)",
"KW": "Kuwait",
"KY": "Caim\u00e1n, (las) Islas",
"KZ": "Kazajst\u00e1n",
"LA": "Lao, (la) Rep\u00fablica Democr\u00e1tica Popular",
"LB": "L\u00edbano",
"LC": "Santa Luc\u00eda",
"LI": "Liechtenstein",
"LK": "Sri Lanka",
"LR": "Liberia",
"LS": "Lesotho",
"LT": "Lituania",
"LU": "Luxemburgo",
"LV": "Letonia",
"LY": "Libia",
"MA": "Marruecos",
"MC": "M\u00f3naco",
"MD": "Moldova (la Rep\u00fablica de)",
"ME": "Montenegro",
"MF": "Saint Martin (parte francesa)",
"MG": "Madagascar",
"MH": "Marshall, (las) Islas",
"MK": "Macedonia (la ex Rep\u00fablica Yugoslava de)",
"ML": "Mal\u00ed",
"MM": "Myanmar",
"MN": "Mongolia",
"MO": "Macao",
"MP": "Marianas del Norte, (las) Islas",
"MQ": "Martinique",
"MR": "Mauritania",
"MS": "Montserrat",
"MT": "Malta",
"MU": "Mauricio",
"MV": "Maldivas",
"MW": "Malawi",
"MX": "M\u00e9xico",
"MY": "Malasia",
"MZ": "Mozambique",
"NA": "Namibia",
"NC": "Nueva Caledonia",
"NE": "N\u00edger (el)",
"NF": "Norfolk, Isla",
"NG": "Nigeria",
"NI": "Nicaragua",
"NL": "Pa\u00edses Bajos (los)",
"NO": "Noruega",
"NP": "Nepal",
"NR": "Nauru",
"NU": "Niue",
"NZ": "Nueva Zelandia",
"OM": "Om\u00e1n",
"PA": "Panam\u00e1",
"PE": "Per\u00fa",
"PF": "Polinesia Francesa",
"PG": "Papua Nueva Guinea",
"PH": "Filipinas (las)",
"PK": "Pakist\u00e1n",
"PL": "Polonia",
"PM": "San Pedro y Miquel\u00f3n",
"PN": "Pitcairn",
"PR": "Puerto Rico",
"PS": "Palestina, Estado de",
"PT": "Portugal",
"PW": "Palau",
"PY": "Paraguay",
"QA": "Qatar",
"RE": "Reuni\u00f3n",
"RO": "Rumania",
"RS": "Serbia",
"RU": "Rusia, (la) Federaci\u00f3n de",
"RW": "Rwanda",
"SA": "Arabia Saudita",
"SB": "Salom\u00f3n, Islas",
"SC": "Seychelles",
"SD": "Sud\u00e1n (el)",
"SE": "Suecia",
"SG": "Singapur",
"SH": "Santa Helena, Ascensi\u00f3n y Trist\u00e1n de Acu\u00f1a",
"SI": "Eslovenia",
"SJ": "Svalbard y Jan Mayen",
"SK": "Eslovaquia",
"SL": "Sierra leona",
"SM": "San Marino",
"SN": "Senegal",
"SO": "Somalia",
"SR": "Suriname",
"SS": "Sud\u00e1n del Sur",
"ST": "Santo Tom\u00e9 y Pr\u00edncipe",
"SV": "El Salvador",
"SX": "Sint Maarten (parte neerlandesa)",
"SY": "Rep\u00fablica \u00c1rabe Siria",
"SZ": "Swazilandia",
"TC": "Turcas y Caicos, (las) Islas",
"TD": "Chad",
"TF": "Tierras Australes Francesas (las)",
"TG": "Togo",
"TH": "Tailandia",
"TJ": "Tayikist\u00e1n",
"TK": "Tokelau",
"TL": "Timor-Leste",
"TM": "Turkmenist\u00e1n",
"TN": "T\u00fanez",
"TO": "Tonga",
"TR": "Turqu\u00eda",
"TT": "Trinidad y Tabago",
"TV": "Tuvalu",
"TW": "Taiw\u00e1n (Provincia de China)",
"TZ": "Tanzania, Rep\u00fablica Unida de",
"UA": "Ucrania",
"UG": "Uganda",
"UM": "Islas Ultramarinas Menores de los Estados Unidos (las)",
"US": "Estados Unidos de Am\u00e9rica (los)",
"UY": "Uruguay",
"UZ": "Uzbekist\u00e1n",
"VA": "Santa Sede (la)",
"VC": "San Vicente y las Granadinas",
"VE": "Venezuela (Rep\u00fablica Bolivariana de)",
"VG": "V\u00edrgenes brit\u00e1nicas, Islas",
"VI": "V\u00edrgenes de los Estados Unidos, Islas",
"VN": "Viet Nam",
"VU": "Vanuatu",
"WF": "Wallis y Futuna",
"WS": "Samoa",
"YE": "Yemen",
"YT": "Mayotte",
"ZA": "Sud\u00e1frica",
"ZM": "Zambia",
"ZW": "Zimbabwe"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment