country names are unicode

This commit is contained in:
j 2012-06-04 21:25:41 +02:00
parent ddecba1d1f
commit 77d7d7a2ec

518
ox/geo.py
View file

@ -15,266 +15,266 @@ Ox.print(JSON.stringify(countries));
'''
COUNTRIES = {
"AC": "Ascension",
"AD": "Andorra",
"AE": "United Arab Emirates",
"AF": "Afghanistan",
"AG": "Antigua and Barbuda",
"AI": "Anguilla",
"AL": "Albania",
"AM": "Armenia",
"AO": "Angola",
"AQ": "Antarctica",
"AR": "Argentina",
"AS": "American Samoa",
"AT": "Austria",
"AU": "Australia",
"AW": "Aruba",
"AX": "Åland Islands",
"AZ": "Azerbaijan",
"BA": "Bosnia and Herzegovina",
"BB": "Barbados",
"BD": "Bangladesh",
"BE": "Belgium",
"BF": "Burkina Faso",
"BG": "Bulgaria",
"BH": "Bahrain",
"BI": "Burundi",
"BJ": "Benin",
"BL": "Saint Barthélemy",
"BM": "Bermuda",
"BN": "Brunei",
"BO": "Bolivia",
"BQ": "Bonaire, Sint Eustatius and Saba",
"BR": "Brazil",
"BS": "Bahamas",
"BT": "Bhutan",
"BV": "Bouvet Island",
"BW": "Botswana",
"BY": "Belarus",
"BZ": "Belize",
"CA": "Canada",
"CC": "Cocos Islands",
"CD": "Democratic Republic of the Congo",
"CF": "Central African Republic",
"CG": "Republic of the Congo",
"CH": "Switzerland",
"CI": "Côte d'Ivoire",
"CK": "Cook Islands",
"CL": "Chile",
"CM": "Cameroon",
"CN": "China",
"CO": "Colombia",
"CP": "Clipperton Island",
"CR": "Costa Rica",
"CU": "Cuba",
"CV": "Cape Verde",
"CW": "Curaçao",
"CX": "Christmas Island",
"CY": "Cyprus",
"CZ": "Czech Republic",
"DE": "Germany",
"DG": "Diego Garcia",
"DJ": "Djibouti",
"DK": "Denmark",
"DM": "Dominica",
"DO": "Dominican Republic",
"DZ": "Algeria",
"EA": "Ceuta and Melilla",
"EC": "Ecuador",
"EE": "Estonia",
"EG": "Egypt",
"EH": "Sahrawi",
"ER": "Eritrea",
"ES": "Spain",
"ET": "Ethiopia",
"EU": "European Union",
"FI": "Finland",
"FJ": "Fiji",
"FK": "Falkland Islands",
"FM": "Micronesia",
"FO": "Faroe Islands",
"FR": "France",
"GA": "Gabon",
"GB": "United Kingdom",
"GD": "Grenada",
"GE": "Georgia",
"GF": "French Guiana",
"GG": "Guernsey",
"GH": "Ghana",
"GI": "Gibraltar",
"GL": "Greenland",
"GM": "Gambia",
"GN": "Guinea",
"GP": "Guadeloupe",
"GQ": "Equatorial Guinea",
"GR": "Greece",
"GS": "South Georgia and the South Sandwich Islands",
"GT": "Guatemala",
"GU": "Guam",
"GW": "Guinea-Bissau",
"GY": "Guyana",
"HK": "Hong Kong",
"HM": "Heard Island and McDonald Islands",
"HN": "Honduras",
"HR": "Croatia",
"HT": "Haiti",
"HU": "Hungary",
"IC": "Canary Islands",
"ID": "Indonesia",
"IE": "Ireland",
"IL": "Israel",
"IM": "Isle of Man",
"IN": "India",
"IO": "British Indian Ocean Territory",
"IQ": "Iraq",
"IR": "Iran",
"IS": "Iceland",
"IT": "Italy",
"JE": "Jersey",
"JM": "Jamaica",
"JO": "Jordan",
"JP": "Japan",
"KE": "Kenya",
"KG": "Kyrgyzstan",
"KH": "Cambodia",
"KI": "Kiribati",
"KM": "Comoros",
"KN": "Saint Kitts and Nevis",
"KP": "North Korea",
"KR": "South Korea",
"KW": "Kuwait",
"KY": "Cayman Islands",
"KZ": "Kazakhstan",
"LA": "Laos",
"LB": "Lebanon",
"LC": "Saint Lucia",
"LI": "Liechtenstein",
"LK": "Sri Lanka",
"LR": "Liberia",
"LS": "Lesotho",
"LT": "Lithuania",
"LU": "Luxembourg",
"LV": "Latvia",
"LY": "Libya",
"MA": "Morocco",
"MC": "Monaco",
"MD": "Moldova",
"ME": "Montenegro",
"MF": "Saint Martin",
"MG": "Madagascar",
"MH": "Marshall Islands",
"MK": "Macedonia",
"ML": "Mali",
"MM": "Myanmar",
"MN": "Mongolia",
"MO": "Macau",
"MP": "Northern Mariana Islands",
"MQ": "Martinique",
"MR": "Mauritania",
"MS": "Montserrat",
"MT": "Malta",
"MU": "Mauritius",
"MV": "Maldives",
"MW": "Malawi",
"MX": "Mexico",
"MY": "Malaysia",
"MZ": "Mozambique",
"NA": "Namibia",
"NC": "New Caledonia",
"NE": "Niger",
"NF": "Norfolk Island",
"NG": "Nigeria",
"NI": "Nicaragua",
"NL": "Netherlands",
"NO": "Norway",
"NP": "Nepal",
"NR": "Nauru",
"NU": "Niue",
"NZ": "New Zealand",
"OM": "Oman",
"PA": "Panama",
"PE": "Peru",
"PF": "French Polynesia",
"PG": "Papua New Guinea",
"PH": "Philippines",
"PK": "Pakistan",
"PL": "Poland",
"PM": "Saint Pierre and Miquelon",
"PN": "Pitcairn Islands",
"PR": "Puerto Rico",
"PS": "Palestine",
"PT": "Portugal",
"PW": "Palau",
"PY": "Paraguay",
"QA": "Qatar",
"RE": "Réunion",
"RO": "Romania",
"RS": "Serbia",
"RU": "Russia",
"RW": "Rwanda",
"SA": "Saudi Arabia",
"SB": "Solomon Islands",
"SC": "Seychelles",
"SD": "Sudan",
"SE": "Sweden",
"SG": "Singapore",
"SH": "Saint Helena, Ascension and Tristan da Cunha",
"SI": "Slovenia",
"SJ": "Svalbard and Jan Mayen",
"SK": "Slovakia",
"SL": "Sierra Leone",
"SM": "San Marino",
"SN": "Senegal",
"SO": "Somalia",
"SR": "Suriname",
"SS": "South Sudan",
"ST": "São Tomé and Príncipe",
"SV": "El Salvador",
"SX": "Sint Maarten",
"SY": "Syria",
"SZ": "Swaziland",
"TA": "Tristan da Cunha",
"TC": "Turks and Caicos Islands",
"TD": "Chad",
"TF": "French Southern Territories",
"TG": "Togo",
"TH": "Thailand",
"TJ": "Tajikistan",
"TK": "Tokelau",
"TL": "Timor-Leste",
"TM": "Turkmenistan",
"TN": "Tunisia",
"TO": "Tonga",
"TR": "Turkey",
"TT": "Trinidad and Tobago",
"TV": "Tuvalu",
"TW": "Taiwan",
"TZ": "Tanzania",
"UA": "Ukraine",
"UG": "Uganda",
"UK": "United Kingdom",
"UM": "United States Minor Outlying Islands",
"US": "United States",
"UY": "Uruguay",
"UZ": "Uzbekistan",
"VA": "Vatican City",
"VC": "Saint Vincent and the Grenadines",
"VE": "Venezuela",
"VG": "British Virgin Islands",
"VI": "United States Virgin Islands",
"VN": "Vietnam",
"VU": "Vanuatu",
"WF": "Wallis and Futuna",
"WS": "Samoa",
"XK": "Kosovo",
"YE": "Yemen",
"YT": "Mayotte",
"ZA": "South Africa",
"ZM": "Zambia",
"ZW": "Zimbabwe"
"AC": u"Ascension",
"AD": u"Andorra",
"AE": u"United Arab Emirates",
"AF": u"Afghanistan",
"AG": u"Antigua and Barbuda",
"AI": u"Anguilla",
"AL": u"Albania",
"AM": u"Armenia",
"AO": u"Angola",
"AQ": u"Antarctica",
"AR": u"Argentina",
"AS": u"American Samoa",
"AT": u"Austria",
"AU": u"Australia",
"AW": u"Aruba",
"AX": u"Åland Islands",
"AZ": u"Azerbaijan",
"BA": u"Bosnia and Herzegovina",
"BB": u"Barbados",
"BD": u"Bangladesh",
"BE": u"Belgium",
"BF": u"Burkina Faso",
"BG": u"Bulgaria",
"BH": u"Bahrain",
"BI": u"Burundi",
"BJ": u"Benin",
"BL": u"Saint Barthélemy",
"BM": u"Bermuda",
"BN": u"Brunei",
"BO": u"Bolivia",
"BQ": u"Bonaire, Sint Eustatius and Saba",
"BR": u"Brazil",
"BS": u"Bahamas",
"BT": u"Bhutan",
"BV": u"Bouvet Island",
"BW": u"Botswana",
"BY": u"Belarus",
"BZ": u"Belize",
"CA": u"Canada",
"CC": u"Cocos Islands",
"CD": u"Democratic Republic of the Congo",
"CF": u"Central African Republic",
"CG": u"Republic of the Congo",
"CH": u"Switzerland",
"CI": u"Côte d'Ivoire",
"CK": u"Cook Islands",
"CL": u"Chile",
"CM": u"Cameroon",
"CN": u"China",
"CO": u"Colombia",
"CP": u"Clipperton Island",
"CR": u"Costa Rica",
"CU": u"Cuba",
"CV": u"Cape Verde",
"CW": u"Curaçao",
"CX": u"Christmas Island",
"CY": u"Cyprus",
"CZ": u"Czech Republic",
"DE": u"Germany",
"DG": u"Diego Garcia",
"DJ": u"Djibouti",
"DK": u"Denmark",
"DM": u"Dominica",
"DO": u"Dominican Republic",
"DZ": u"Algeria",
"EA": u"Ceuta and Melilla",
"EC": u"Ecuador",
"EE": u"Estonia",
"EG": u"Egypt",
"EH": u"Sahrawi",
"ER": u"Eritrea",
"ES": u"Spain",
"ET": u"Ethiopia",
"EU": u"European Union",
"FI": u"Finland",
"FJ": u"Fiji",
"FK": u"Falkland Islands",
"FM": u"Micronesia",
"FO": u"Faroe Islands",
"FR": u"France",
"GA": u"Gabon",
"GB": u"United Kingdom",
"GD": u"Grenada",
"GE": u"Georgia",
"GF": u"French Guiana",
"GG": u"Guernsey",
"GH": u"Ghana",
"GI": u"Gibraltar",
"GL": u"Greenland",
"GM": u"Gambia",
"GN": u"Guinea",
"GP": u"Guadeloupe",
"GQ": u"Equatorial Guinea",
"GR": u"Greece",
"GS": u"South Georgia and the South Sandwich Islands",
"GT": u"Guatemala",
"GU": u"Guam",
"GW": u"Guinea-Bissau",
"GY": u"Guyana",
"HK": u"Hong Kong",
"HM": u"Heard Island and McDonald Islands",
"HN": u"Honduras",
"HR": u"Croatia",
"HT": u"Haiti",
"HU": u"Hungary",
"IC": u"Canary Islands",
"ID": u"Indonesia",
"IE": u"Ireland",
"IL": u"Israel",
"IM": u"Isle of Man",
"IN": u"India",
"IO": u"British Indian Ocean Territory",
"IQ": u"Iraq",
"IR": u"Iran",
"IS": u"Iceland",
"IT": u"Italy",
"JE": u"Jersey",
"JM": u"Jamaica",
"JO": u"Jordan",
"JP": u"Japan",
"KE": u"Kenya",
"KG": u"Kyrgyzstan",
"KH": u"Cambodia",
"KI": u"Kiribati",
"KM": u"Comoros",
"KN": u"Saint Kitts and Nevis",
"KP": u"North Korea",
"KR": u"South Korea",
"KW": u"Kuwait",
"KY": u"Cayman Islands",
"KZ": u"Kazakhstan",
"LA": u"Laos",
"LB": u"Lebanon",
"LC": u"Saint Lucia",
"LI": u"Liechtenstein",
"LK": u"Sri Lanka",
"LR": u"Liberia",
"LS": u"Lesotho",
"LT": u"Lithuania",
"LU": u"Luxembourg",
"LV": u"Latvia",
"LY": u"Libya",
"MA": u"Morocco",
"MC": u"Monaco",
"MD": u"Moldova",
"ME": u"Montenegro",
"MF": u"Saint Martin",
"MG": u"Madagascar",
"MH": u"Marshall Islands",
"MK": u"Macedonia",
"ML": u"Mali",
"MM": u"Myanmar",
"MN": u"Mongolia",
"MO": u"Macau",
"MP": u"Northern Mariana Islands",
"MQ": u"Martinique",
"MR": u"Mauritania",
"MS": u"Montserrat",
"MT": u"Malta",
"MU": u"Mauritius",
"MV": u"Maldives",
"MW": u"Malawi",
"MX": u"Mexico",
"MY": u"Malaysia",
"MZ": u"Mozambique",
"NA": u"Namibia",
"NC": u"New Caledonia",
"NE": u"Niger",
"NF": u"Norfolk Island",
"NG": u"Nigeria",
"NI": u"Nicaragua",
"NL": u"Netherlands",
"NO": u"Norway",
"NP": u"Nepal",
"NR": u"Nauru",
"NU": u"Niue",
"NZ": u"New Zealand",
"OM": u"Oman",
"PA": u"Panama",
"PE": u"Peru",
"PF": u"French Polynesia",
"PG": u"Papua New Guinea",
"PH": u"Philippines",
"PK": u"Pakistan",
"PL": u"Poland",
"PM": u"Saint Pierre and Miquelon",
"PN": u"Pitcairn Islands",
"PR": u"Puerto Rico",
"PS": u"Palestine",
"PT": u"Portugal",
"PW": u"Palau",
"PY": u"Paraguay",
"QA": u"Qatar",
"RE": u"Réunion",
"RO": u"Romania",
"RS": u"Serbia",
"RU": u"Russia",
"RW": u"Rwanda",
"SA": u"Saudi Arabia",
"SB": u"Solomon Islands",
"SC": u"Seychelles",
"SD": u"Sudan",
"SE": u"Sweden",
"SG": u"Singapore",
"SH": u"Saint Helena, Ascension and Tristan da Cunha",
"SI": u"Slovenia",
"SJ": u"Svalbard and Jan Mayen",
"SK": u"Slovakia",
"SL": u"Sierra Leone",
"SM": u"San Marino",
"SN": u"Senegal",
"SO": u"Somalia",
"SR": u"Suriname",
"SS": u"South Sudan",
"ST": u"São Tomé and Príncipe",
"SV": u"El Salvador",
"SX": u"Sint Maarten",
"SY": u"Syria",
"SZ": u"Swaziland",
"TA": u"Tristan da Cunha",
"TC": u"Turks and Caicos Islands",
"TD": u"Chad",
"TF": u"French Southern Territories",
"TG": u"Togo",
"TH": u"Thailand",
"TJ": u"Tajikistan",
"TK": u"Tokelau",
"TL": u"Timor-Leste",
"TM": u"Turkmenistan",
"TN": u"Tunisia",
"TO": u"Tonga",
"TR": u"Turkey",
"TT": u"Trinidad and Tobago",
"TV": u"Tuvalu",
"TW": u"Taiwan",
"TZ": u"Tanzania",
"UA": u"Ukraine",
"UG": u"Uganda",
"UK": u"United Kingdom",
"UM": u"United States Minor Outlying Islands",
"US": u"United States",
"UY": u"Uruguay",
"UZ": u"Uzbekistan",
"VA": u"Vatican City",
"VC": u"Saint Vincent and the Grenadines",
"VE": u"Venezuela",
"VG": u"British Virgin Islands",
"VI": u"United States Virgin Islands",
"VN": u"Vietnam",
"VU": u"Vanuatu",
"WF": u"Wallis and Futuna",
"WS": u"Samoa",
"XK": u"Kosovo",
"YE": u"Yemen",
"YT": u"Mayotte",
"ZA": u"South Africa",
"ZM": u"Zambia",
"ZW": u"Zimbabwe"
}
def get_country_name(country_code):
country_code = country_code.upper()
return COUNTRIES[country_code] if country_code in COUNTRIES else ''
return COUNTRIES[country_code] if country_code in COUNTRIES else u''