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