2008-10-21 41 views
7

Cuando trato de crear una nueva RegionInfo con ciertos códigos de país ISO 3166 ("BD" para Bangladesh, "SO" para Somalia, "LK" para Sri Lanka), obtengo una ArgumentException que dice que no es Reconocido..NET clase RegionInfo

¿Cuál es el problema? El Intellisense de RegionInfo (cadena) dice que cumple con ISO 3166, pero estos códigos de país/región no son compatibles.

No lo entiendo.

Respuesta

2

Algunas de las regiones que extrañó ahora son compatibles (en versiones más recientes de .NET Framework).

El código siguiente busca todos RegionInfo que son "accesibles" de una cultura específica:

foreach (var ri in CultureInfo.GetCultures(CultureTypes.SpecificCultures).Select(ci => new RegionInfo(ci.ToString())).OrderBy(x => x.TwoLetterISORegionName)) 
    Console.WriteLine("{0,3}: {1,11}: {2} ({3})", ri.TwoLetterISORegionName, ri, ri.EnglishName, ri.NativeName); 

En mi máquina en este momento se da:

 
029:  en-029: Caribbean (Caribbean) 
AE:  ar-AE: U.A.E. (الإمارات العربية المتحدة) 
AF:  ps-AF: Afghanistan (افغانستان) 
AF:  prs-AF: Afghanistan (افغانستان) 
AL:  sq-AL: Albania (Shqipëria) 
AM:  hy-AM: Armenia (Հայաստան) 
AR:  es-AR: Argentina (Argentina) 
AT:  de-AT: Austria (Österreich) 
AU:  en-AU: Australia (Australia) 
AZ: az-Latn-AZ: Azerbaijan (Azərbaycan) 
AZ: az-Cyrl-AZ: Azerbaijan (Азәрбајҹан) 
BA:  hr-BA: Bosnia and Herzegovina (Bosna i Hercegovina) 
BA: bs-Latn-BA: Bosnia and Herzegovina (Bosna i Hercegovina) 
BA: sr-Latn-BA: Bosnia and Herzegovina (Bosna i Hercegovina) 
BA: sr-Cyrl-BA: Bosnia and Herzegovina (Босна и Херцеговина) 
BA: bs-Cyrl-BA: Bosnia and Herzegovina (Босна и Херцеговина) 
BD:  bn-BD: Bangladesh (বাংলাদেশ) 
BE:  fr-BE: Belgium (Belgique) 
BE:  nl-BE: Belgium (België) 
BG:  bg-BG: Bulgaria (България) 
BH:  ar-BH: Bahrain (البحرين) 
BN:  ms-BN: Brunei Darussalam (Brunei Darussalam) 
BO:  quz-BO: Bolivia (Bolivia Suyu) 
BO:  es-BO: Bolivia (Bolivia) 
BR:  pt-BR: Brazil (Brasil) 
BY:  be-BY: Belarus (Беларусь) 
BZ:  en-BZ: Belize (Belize) 
CA: iu-Cans-CA: Canada (ᑲᓇᑕ) 
CA:  moh-CA: Canada (Canada) 
CA: iu-Latn-CA: Canada (kanata) 
CA:  fr-CA: Canada (Canada) 
CA:  en-CA: Canada (Canada) 
CH:  rm-CH: Switzerland (Svizra) 
CH:  de-CH: Switzerland (Schweiz) 
CH:  it-CH: Switzerland (Svizzera) 
CH:  fr-CH: Switzerland (Suisse) 
CL:  arn-CL: Chile (Chile) 
CL:  es-CL: Chile (Chile) 
CN:  bo-CN: People's Republic of China (ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།) 
CN:  ii-CN: People's Republic of China (ꍏꉸꏓꂱꇭꉼꇩ) 
CN:  ug-CN: People's Republic of China (جۇڭخۇا خەلق جۇمھۇرىيىتى) 
CN:  zh-CN: People's Republic of China (中华人民共和国) 
CN: mn-Mong-CN: People's Republic of China (ᠪᠦᠭᠦᠳᠡ ᠨᠠᠢᠷᠠᠮᠳᠠᠬᠤ ᠳᠤᠮᠳᠠᠳᠤ ᠠᠷᠠᠳ ᠣᠯᠣᠰ) 
CO:  es-CO: Colombia (Colombia) 
CR:  es-CR: Costa Rica (Costa Rica) 
CS: sr-Latn-CS: Serbia and Montenegro (Former) (Srbija i Crna Gora (Prethodno)) 
CS: sr-Cyrl-CS: Serbia and Montenegro (Former) (Србија и Црна Гора (Претходно)) 
CZ:  cs-CZ: Czech Republic (Česká republika) 
DE:  de-DE: Germany (Deutschland) 
DE:  hsb-DE: Germany (Němska) 
DE:  dsb-DE: Germany (Nimska) 
DK:  da-DK: Denmark (Danmark) 
DO:  es-DO: Dominican Republic (República Dominicana) 
DZ: tzm-Latn-DZ: Algeria (Djazaïr) 
DZ:  ar-DZ: Algeria (الجزائر) 
EC:  quz-EC: Ecuador (Ecuador Suyu) 
EC:  es-EC: Ecuador (Ecuador) 
EE:  et-EE: Estonia (Eesti) 
EG:  ar-EG: Egypt (مصر) 
ES:  ca-ES: Spain (Espanya) 
ES:  eu-ES: Spain (Espainia) 
ES:  gl-ES: Spain (España) 
ES:  es-ES: Spain (España) 
ET:  am-ET: Ethiopia (ኢትዮጵያ) 
FI:  fi-FI: Finland (Suomi) 
FI:  sv-FI: Finland (Finland) 
FI:  se-FI: Finland (Suopma) 
FI:  sms-FI: Finland (Lää´ddjânnam) 
FI:  smn-FI: Finland (Suomâ) 
FO:  fo-FO: Faroe Islands (Føroyar) 
FR:  fr-FR: France (France) 
FR:  br-FR: France (Frañs) 
FR:  oc-FR: France (França) 
FR:  co-FR: France (France) 
FR:  gsw-FR: France (Frànkrisch) 
GB:  cy-GB: United Kingdom (y Deyrnas Unedig) 
GB:  gd-GB: United Kingdom (An Rìoghachd Aonaichte) 
GB:  en-GB: United Kingdom (United Kingdom) 
GE:  ka-GE: Georgia (საქართველო) 
GL:  kl-GL: Greenland (Kalaallit Nunaat) 
GR:  el-GR: Greece (Ελλάδα) 
GT:  qut-GT: Guatemala (Guatemala) 
GT:  es-GT: Guatemala (Guatemala) 
HK:  zh-HK: Hong Kong S.A.R. (香港特別行政區) 
HN:  es-HN: Honduras (Honduras) 
HR:  hr-HR: Croatia (Hrvatska) 
HU:  hu-HU: Hungary (Magyarország) 
ID:  id-ID: Indonesia (Indonesia) 
IE:  ga-IE: Ireland (Éire) 
IE:  en-IE: Ireland (Ireland) 
IL:  he-IL: Israel (ישראל) 
IN:  hi-IN: India (भारत) 
IN:  bn-IN: India (ভারত) 
IN:  pa-IN: India (ਭਾਰਤ) 
IN:  gu-IN: India (ભારત) 
IN:  or-IN: India (ଭାରତ) 
IN:  ta-IN: India (இந்தியா) 
IN:  te-IN: India (భారత దేశం) 
IN:  kn-IN: India (ಭಾರತ) 
IN:  ml-IN: India (ഭാരതം) 
IN:  as-IN: India (ভাৰত) 
IN:  mr-IN: India (भारत) 
IN:  sa-IN: India (भारतम्) 
IN:  kok-IN: India (भारत) 
IN:  en-IN: India (India) 
IQ:  ar-IQ: Iraq (العراق) 
IR:  fa-IR: Iran (ایران) 
IS:  is-IS: Iceland (Ísland) 
IT:  it-IT: Italy (Italia) 
JM:  en-JM: Jamaica (Jamaica) 
JO:  ar-JO: Jordan (الأردن) 
JP:  ja-JP: Japan (日本) 
KE:  sw-KE: Kenya (Kenya) 
KG:  ky-KG: Kyrgyzstan (Кыргызстан) 
KH:  km-KH: Cambodia (កម្ពុជា) 
KR:  ko-KR: Korea (대한민국) 
KW:  ar-KW: Kuwait (الكويت) 
KZ:  kk-KZ: Kazakhstan (Қазақстан) 
LA:  lo-LA: Lao P.D.R. (ສ.ປ.ປ. ລາວ) 
LB:  ar-LB: Lebanon (لبنان) 
LI:  de-LI: Liechtenstein (Liechtenstein) 
LK:  si-LK: Sri Lanka (ශ්‍රී ලංකා) 
LT:  lt-LT: Lithuania (Lietuva) 
LU:  lb-LU: Luxembourg (Luxembourg) 
LU:  de-LU: Luxembourg (Luxemburg) 
LU:  fr-LU: Luxembourg (Luxembourg) 
LV:  lv-LV: Latvia (Latvija) 
LY:  ar-LY: Libya (ليبيا) 
MA:  ar-MA: Morocco (المملكة المغربية) 
MC:  fr-MC: Principality of Monaco (Principauté de Monaco) 
ME: sr-Latn-ME: Montenegro (Crna Gora) 
ME: sr-Cyrl-ME: Montenegro (Црна Гора) 
MK:  mk-MK: Macedonia (FYROM) (Македонија) 
MN:  mn-MN: Mongolia (Монгол улс) 
MO:  zh-MO: Macao S.A.R. (澳門特別行政區) 
MT:  mt-MT: Malta (Malta) 
MV:  dv-MV: Maldives (ދިވެހި ރާއްޖެ) 
MX:  es-MX: Mexico (México) 
MY:  ms-MY: Malaysia (Malaysia) 
MY:  en-MY: Malaysia (Malaysia) 
NG: ha-Latn-NG: Nigeria (Nigeria) 
NG:  yo-NG: Nigeria (Nigeria) 
NG:  ig-NG: Nigeria (Nigeria) 
NI:  es-NI: Nicaragua (Nicaragua) 
NL:  nl-NL: Netherlands (Nederland) 
NL:  fy-NL: Netherlands (Nederlân) 
NO:  nb-NO: Norway (Norge) 
NO:  se-NO: Norway (Norga) 
NO:  nn-NO: Norway (Noreg) 
NO:  smj-NO: Norway (Vuodna) 
NO:  sma-NO: Norway (Nöörje) 
NP:  ne-NP: Nepal (नेपाल) 
NZ:  mi-NZ: New Zealand (Aotearoa) 
NZ:  en-NZ: New Zealand (New Zealand) 
OM:  ar-OM: Oman (عمان) 
PA:  es-PA: Panama (Panamá) 
PE:  quz-PE: Peru (Peru Suyu) 
PE:  es-PE: Peru (Perú) 
PH:  fil-PH: Philippines (Pilipinas) 
PH:  en-PH: Republic of the Philippines (Philippines) 
PK:  ur-PK: Islamic Republic of Pakistan (پاکستان) 
PL:  pl-PL: Poland (Polska) 
PR:  es-PR: Puerto Rico (Puerto Rico) 
PT:  pt-PT: Portugal (Portugal) 
PY:  es-PY: Paraguay (Paraguay) 
QA:  ar-QA: Qatar (قطر) 
RO:  ro-RO: Romania (România) 
RS: sr-Latn-RS: Serbia (Srbija) 
RS: sr-Cyrl-RS: Serbia (Србија) 
RU:  ru-RU: Russia (Россия) 
RU:  tt-RU: Russia (Россия) 
RU:  ba-RU: Russia (Россия) 
RU:  sah-RU: Russia (Россия) 
RW:  rw-RW: Rwanda (Rwanda) 
SA:  ar-SA: Saudi Arabia (المملكة العربية السعودية) 
SE:  sv-SE: Sweden (Sverige) 
SE:  se-SE: Sweden (Ruoŧŧa) 
SE:  smj-SE: Sweden (Svierik) 
SE:  sma-SE: Sweden (Sveerje) 
SG:  zh-SG: Singapore (新加坡) 
SG:  en-SG: Singapore (Singapore) 
SI:  sl-SI: Slovenia (Slovenija) 
SK:  sk-SK: Slovakia (Slovenská republika) 
SN:  wo-SN: Senegal (Sénégal) 
SV:  es-SV: El Salvador (El Salvador) 
SY:  syr-SY: Syria (سوريا) 
SY:  ar-SY: Syria (سوريا) 
TH:  th-TH: Thailand (ไทย) 
TJ: tg-Cyrl-TJ: Tajikistan (Тоҷикистон) 
TM:  tk-TM: Turkmenistan (Türkmenistan) 
TN:  ar-TN: Tunisia (تونس) 
TR:  tr-TR: Turkey (Türkiye) 
TT:  en-TT: Trinidad and Tobago (Trinidad y Tobago) 
TW:  zh-TW: Taiwan (台灣) 
UA:  uk-UA: Ukraine (Україна) 
US:  en-US: United States (United States) 
US:  es-US: United States (Estados Unidos) 
UY:  es-UY: Uruguay (Uruguay) 
UZ: uz-Latn-UZ: Uzbekistan (U'zbekiston Respublikasi) 
UZ: uz-Cyrl-UZ: Uzbekistan (Ўзбекистон Республикаси) 
VE:  es-VE: Bolivarian Republic of Venezuela (Republica Bolivariana de Venezuela) 
VN:  vi-VN: Vietnam (Việt Nam) 
YE:  ar-YE: Yemen (اليمن) 
ZA:  tn-ZA: South Africa (Aforika Borwa) 
ZA:  xh-ZA: South Africa (uMzantsi Afrika) 
ZA:  zu-ZA: South Africa (iNingizimu Afrika) 
ZA:  af-ZA: South Africa (Suid Afrika) 
ZA:  nso-ZA: South Africa (Afrika Borwa) 
ZA:  en-ZA: South Africa (South Africa) 
ZW:  en-ZW: Zimbabwe (Zimbabwe) 

Cuestiones relacionadas