Modul:ISO 3166/data
Robâ
The subpages of this module contain the ISO 3166 codes used by Module:ISO 3166. This module itself is for maintenance/internal use and should not be used in articles.
Subpages
- National
- AD (Andorra)
- AE (Uni Emirat Arab)
- AF (Afganistan)
- AG (Antigua dan Barbuda)
- AI (Anguilla)
- AL (Albania)
- AM (Armenia)
- AO (Angola)
- AQ (Antarktika)
- AR (Argentina)
- AS (Samoa Amerika)
- AT (Austria)
- AU (Australia)
- AW (Aruba)
- AX (Kepulauan Åland)
- AZ (Azerbaijan)
- BA (Bosnia dan Herzegovina)
- BB (Barbados)
- BD (Bangladesh)
- BE (Belgia)
- BF (Burkina Faso)
- BG (Bulgaria)
- BH (Bahrain)
- BI (Burundi)
- BJ (Benin)
- BL (Saint Barthélemy)
- BM (Bermuda)
- BN (Brunei)
- BO (Bolivia)
- BQ (Karibia Belanda)
- BR (Brasil)
- BS (Bahama)
- BT (Bhutan)
- BV (Pulau Bouvet)
- BW (Botswana)
- BY (Belarus)
- BZ (Belize)
- CA (Kanada)
- CC (Kepulauan Cocos (Keeling))
- CD (Republik Demokratik Kongo)
- CF (Republik Afrika Tengah)
- CG (Republik Kongo)
- CH (Switzerland)
- CI (Pantai Gading)
- CK (Kepulauan Cook)
- CL (Chili)
- CM (Kamerun)
- CN (Tiongkok)
- CO (Kolombia)
- CR (Kosta Rika)
- CU (Kuba)
- CV (Cabo Verde)
- CW (Curaçao)
- CX (Pulau Christmas)
- CY (Siprus)
- CZ (Republik Ceko)
- DE (Jerman)
- DJ (Djibouti)
- DK (Denmark)
- DM (Dominika)
- DO (Republik Dominika)
- DZ (Aljazair)
- EC (Ekuador)
- EE (Estonia)
- EG (Mesir)
- EH (Sahara Barat)
- ER (Eritrea)
- ES (Spanyol)
- ET (Etiopia)
- FI (Finlandia)
- FJ (Fiji)
- FK (Kepulauan Falkland)
- FM (Negara Federasi Mikronesia)
- FO (Kepulauan Faroe)
- FR (Prancis)
- GA (Gabon)
- GB (Inggris Raya)
- GB-EAW (England and Wales)
- GB-ENG (England)
- GB-NIR (Northern Ireland)
- GB-SCT (Scotland)
- GB-WLS (Wales)
- GD (Grenada)
- GE (Georgia)
- GF (Guyana Prancis)
- GG (Guernsey)
- GH (Ghana)
- GI (Gibraltar)
- GL (Greenland)
- GM (Gambia)
- GN (Guinea)
- GP (Guadeloupe)
- GQ (Guinea Khatulistiwa)
- GR (Yunani)
- GS (Georgia Selatan dan Kepulauan Sandwich Selatan)
- GT (Guatemala)
- GU (Guam)
- GW (Guinea-Bissau)
- GY (Guyana)
- HK (Hong Kong)
- HM (Heard Island and McDonald Islands)
- HN (Honduras)
- HR (Kroasia)
- HT (Haiti)
- HU (Hungaria)
- ID (Indonesia)
- IE (Irlandia)
- IL (Israel)
- IM (Isle of Man)
- IN (India)
- IO (Wilayah Samudra Hindia Britania)
- IQ (Irak)
- IR (Iran)
- IS (Islandia)
- IT (Italia)
- JE (Jersey)
- JM (Jamaika)
- JO (Yordania)
- JP (Jepang)
- KE (Kenya)
- KG (Kirgizstan)
- KH (Kamboja)
- KI (Kiribati)
- KM (Komoro)
- KN (Saint Kitts and Nevis)
- KP (Korea Utara)
- KR (Korea Selatan)
- KW (Kuwait)
- KY (Kepulauan Cayman)
- KZ (Kazakhstan)
- LA (Laos)
- LB (Lebanon)
- LC (Saint Lucia)
- LI (Liechtenstein)
- LK (Sri Lanka)
- LR (Liberia)
- LS (Lesotho)
- LT (Lituania)
- LU (Luksemburg)
- LV (Latvia)
- LY (Libya)
- MA (Maroko)
- MC (Monako)
- MD (Moldova)
- ME (Montenegro)
- MF (Saint-Martin)
- MG (Madagaskar)
- MH (Kepulauan Marshall)
- MK (Republik Makedonia)
- ML (Mali)
- MM (Myanmar)
- MN (Mongolia)
- MO (Makau)
- MP (Kepulauan Mariana Utara)
- MQ (Martinique)
- MR (Mauritania)
- MS (Montserrat)
- MT (Malta)
- MU (Mauritius)
- MV (Maladewa)
- MW (Malawi)
- MX (Meksico)
- MY (Malaysia)
- MZ (Mozambik)
- NA (Namibia)
- NC (Kaledonia Baru)
- NE (Niger)
- NF (Pulau Norfolk)
- NG (Nigeria)
- NI (Nikaragua)
- NL (Belanda)
- NO (Norwegia)
- NP (Nepal)
- NR (Nauru)
- NU (Niue)
- NZ (Selandia Baru)
- OM (Oman)
- PA (Panama)
- PE (Peru)
- PF (Polinesia Perancis)
- PG (Papua Nugini)
- PH (Filipina)
- PK (Pakistan)
- PL (Polandia)
- PM (Saint Pierre and Miquelon)
- PN (Pitcairn)
- PR (Puerto Rico)
- PS (Palestina)
- PT (Portugal)
- PW (Palau)
- PY (Paraguay)
- QA (Qatar)
- RE (Réunion)
- RO (Romania)
- RS (Serbia)
- RU (Rusia)
- RW (Rwanda)
- SA (Arab Saudi)
- SB (Kepulauan Solomon)
- SC (Seychelles)
- SD (Sudan)
- SE (Swedia)
- SG (Singapura)
- SH (Saint Helena, Ascension and Tristan da Cunha)
- SI (Slovenia)
- SJ (Svalbard dan Jan Mayen)
- SK (Slowakia)
- SL (Sierra Leone)
- SM (San Marino)
- SN (Senegal)
- SO (Somalia)
- SR (Suriname)
- SS (Sudan Selatan)
- ST (São Tomé dan Príncipe)
- SV (El Salvador)
- SX (Sint Maarten)
- SY (Suriah)
- SZ (Swaziland)
- TC (Kepulauan Turks dan Caicos)
- TD (Chad)
- TF (Prancis Bagian Selatan dan Antartika)
- TG (Togo)
- TH (Thailand)
- TJ (Tajikistan)
- TK (Tokelau)
- TL (Timor-Leste)
- TM (Turkmenistan)
- TN (Tunisia)
- TO (Tonga)
- TR (Turki)
- TT (Trinidad dan Tobago)
- TV (Tuvalu)
- TW (Taiwan)
- TZ (Tanzania)
- UA (Ukraina)
- UG (Uganda)
- UM (United States Minor Outlying Islands)
- US (United States)
- UY (Uruguay)
- UZ (Uzbekistan)
- VA (Kota Vatican)
- VC (Saint Vincent and the Grenadines)
- VE (Venezuela)
- VG (British Virgin Islands)
- VI (United States Virgin Islands)
- VN (Vietnam)
- VU (Vanuatu)
- WF (Wallis dan Futuna)
- WS (Samoa)
- YE (Yaman)
- YT (Mayotte)
- ZA (Afrika Selatan)
- ZM (Zambia)
- ZW (Zimbabwe)
Problem reports
- Duplicate name: "000" in /National (exact) (GB-SCT)
- Duplicate name: "000" in /National (exact) (GB-NIR)
- Duplicate name: "000" in /National (exact) (GB-EAW)
- Duplicate name: "Saint-Martin" in /National (non-exact) (MF)
- Duplicate name: "Saint Martin (French part)" in /National (non-exact) (MF)
- Duplicate name: "St Martin" in /National (non-exact) (MF)
- Duplicate name: "St Martin (French part)" in /National (non-exact) (MF)
- Duplicate name: "000" in /National (exact) (GB-WLS)
- Duplicate name: "Papua (region)" in /ID (non-exact) (PP)
- Duplicate name: "Maluku (region)" in /ID (non-exact) (ML)
local p = {}
local data = mw.loadData("Module:ISO 3166/data/National")
function p.list(frame)
--Returns a list of subpages and associated countries
local codes = {}
for alpha2,cdata in pairs(data) do
codes[#codes+1] = {alpha2,cdata.name}
end
table.sort(codes, function(t1,t2) return t1[1]<t2[1] end)
local out = {"* [[Module:ISO 3166/data/National|National]]"}
for _,cdata in ipairs(codes) do
out[#out+1] = "* [[Module:ISO 3166/data/"..cdata[1].."|"..cdata[1].." ("..cdata[2]..")]]"
end
return table.concat(out,"\n")
end
function p.subpagetest(frame)
--Returns a table row indicating the existence of data pages (see [[User:SiBr4/sandbox#Data subpage test]])
local function cell(code,d)
local sdata
if not data[code] then
return "" --Unassigned or reserved 3166-1 code
else
local sname = "Module:ISO 3166/data/"..code
if not (d or mw.title.new(sname).exists) then
return "title=\""..data[code].name.."\" style=\"background:#fee;\"|[["..sname.."|-]]" --Data subpage doesn't exist
else
sdata = mw.loadData(sname)
end
end
for _,_ in pairs(sdata) do
return "title=\""..data[code].name.."\" style=\"background:#efe;\"|n" --Non-empty 3166-2 entry
end
return "title=\""..data[code].name.."\" style=\"background:#eef;\"|e" --Empty 3166-2 entry
end
local letter = frame.args[1]
local out = "|-\n!"..letter.."*"
for i = 65, 90 do
out = out.."\n|"..cell(letter..string.char(i),frame.args[2])
end
return out
end
function p.testall(frame)
--Search across all subpages for problems with names
local strip = require("Module:ISO 3166").strip
local function subpage(p)
return "[[Module:ISO 3166/data/"..p.."|/"..p.."]]"
end
local function testname(names,inames,dnames,page,code,name)
if name then
if type(name)~="string" then
dnames[#dnames+1] = "*Unexpected non-string value in "..subpage(page).." ("..code..")"
else
local sname = strip(name)
if not names[sname] then
inames[sname] = name
else
dnames[#dnames+1] = "*Duplicate name: \""..name.."\" in "..subpage(page)
..(names[sname]==name and " (exact)" or " (non-exact)").." ("..code..")"
end
end
end
return names, inames, dnames
end
local function testnametable(names,inames,dnames,page,code,tab)
if tab then
if type(tab)~="table" then
dnames[#dnames+1] = "*Unexpected non-table value in "..subpage(page).." ("..code..")"
else
for _,name in pairs(tab) do
names, inames, dnames = testname(names,inames,dnames,page,code,name)
end
end
end
return names, inames, dnames
end
local fields = {name=1,isoname=1,isonames=1,displayname=1,isodisplayname=1,isodisplaynames=1,altnames=1,lang=1,defaultlang=1,alpha3=1,numeric=1,nocode=1}
local function testentry(names,dnames,page,code,edata)
for k,_ in pairs(edata) do
if not fields[k] then
dnames[#dnames+1] = "*Unknown field \""..k.."\" in "..subpage(page).." ("..code..")"
end
end
local inames = {}
names, inames, dnames = testname(names,inames,dnames,page,code,edata.name)
names, inames, dnames = testname(names,inames,dnames,page,code,edata.isoname)
names, inames, dnames = testnametable(names,inames,dnames,page,code,edata.isonames)
names, inames, dnames = testnametable(names,inames,dnames,page,code,edata.altnames)
if not edata.nocode then
names, inames, dnames = testname(names,inames,dnames,page,code,code)
end
if page=="National" then
names, inames, dnames = testname(names,inames,dnames,page,code,edata.alpha3)
names, inames, dnames = testname(names,inames,dnames,page,code,edata.numeric)
end
for k,v in pairs(inames) do names[k]=v end
return names, dnames
end
local dnames = {}
--ISO 3166-1
local names = {}
for code,cdata in pairs(data) do
names, dnames = testentry(names,dnames,"National",code,cdata)
end
--ISO 3166-2
for code,_ in pairs(data) do
names = {}
local spage = "Module:ISO 3166/data/"..code
if mw.title.new(spage).exists then
local sdata = mw.loadData(spage)
for scode,cdata in pairs(sdata) do
if type(cdata)=="table" then
names, dnames = testentry(names,dnames,code,scode,cdata)
end
end
end
end
if #dnames>0 then
return table.concat(dnames,"\n")
else
return "None"
end
end
return p