]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/wintz.c
ICU-400.37.tar.gz
[apple/icu.git] / icuSources / common / wintz.c
index 136eba9e28774e950c1f208e2930cdff17a8aaf4..ccb30564794f4e10597362d8a5da4621d151aee4 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ********************************************************************************
-*   Copyright (C) 2005-2006, International Business Machines
+*   Copyright (C) 2005-2008, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 ********************************************************************************
 *
@@ -98,124 +98,472 @@ static const char* const TZ_REGKEY[] = {
  * the registry.
  */
 enum {
-    WIN_9X_ME_TYPE = 0,
-    WIN_NT_TYPE = 1,
-    WIN_2K_XP_TYPE = 2
+    WIN_9X_ME_TYPE = 1,
+    WIN_NT_TYPE = 2,
+    WIN_2K_XP_TYPE = 3
 };
 
+# if 0
 /*
- * TODO: Sort on ICU ID?
- * TODO: This data should come from ICU/CLDR...
+ * ZONE_MAP from supplementalData.txt
+ */
+static const WindowsICUMap NEW_ZONE_MAP[] = {
+    {"Africa/Cairo",         "Egypt"},
+    {"Africa/Casablanca",    "Greenwich"},
+    {"Africa/Johannesburg",  "South Africa"},
+    {"Africa/Lagos",         "W. Central Africa"},
+    {"Africa/Nairobi",       "E. Africa"},
+    {"Africa/Windhoek",      "Namibia"},
+    {"America/Anchorage",    "Alaskan"},
+    {"America/Bogota",       "SA Pacific"},
+    {"America/Buenos_Aires", "SA Eastern"},
+    {"America/Caracas",      "SA Western"},
+    {"America/Chicago",      "Central"},
+    {"America/Chihuahua",    "Mountain Standard Time (Mexico)"},
+    {"America/Denver",       "Mountain"},
+    {"America/Godthab",      "Greenland"},
+    {"America/Guatemala",    "Central America"},
+    {"America/Halifax",      "Atlantic"},
+    {"America/Indianapolis", "US Eastern"},
+    {"America/Los_Angeles",  "Pacific"},
+    {"America/Manaus",       "Central Brazilian"},
+    {"America/Mexico_City",  "Central Standard Time (Mexico)"},
+    {"America/Montevideo",   "Montevideo"},
+    {"America/New_York",     "Eastern"},
+    {"America/Noronha",      "Mid-Atlantic"},
+    {"America/Phoenix",      "US Mountain"},
+    {"America/Regina",       "Canada Central"},
+    {"America/Santiago",     "Pacific SA"},
+    {"America/Sao_Paulo",    "E. South America"},
+    {"America/St_Johns",     "Newfoundland"},
+    {"America/Tijuana",      "Pacific Standard Time (Mexico)"},
+    {"Asia/Amman",           "Jordan"},
+    {"Asia/Baghdad",         "Arabic"},
+    {"Asia/Baku",            "Azerbaijan"},
+    {"Asia/Bangkok",         "SE Asia"},
+    {"Asia/Beirut",          "Middle East"},
+    {"Asia/Calcutta",        "India"},
+    {"Asia/Colombo",         "Sri Lanka"},
+    {"Asia/Dhaka",           "Central Asia"},
+    {"Asia/Jerusalem",       "Israel"},
+    {"Asia/Kabul",           "Afghanistan"},
+    {"Asia/Karachi",         "West Asia"},
+    {"Asia/Katmandu",        "Nepal"},
+    {"Asia/Krasnoyarsk",     "North Asia"},
+    {"Asia/Muscat",          "Arabian"},
+    {"Asia/Novosibirsk",     "N. Central Asia"},
+    {"Asia/Rangoon",         "Myanmar"},
+    {"Asia/Riyadh",          "Arab"},
+    {"Asia/Seoul",           "Korea"},
+    {"Asia/Shanghai",        "China"},
+    {"Asia/Singapore",       "Singapore"},
+    {"Asia/Taipei",          "Taipei"},
+    {"Asia/Tbilisi",         "Georgian"},
+    {"Asia/Tehran",          "Iran"},
+    {"Asia/Tokyo",           "Tokyo"},
+    {"Asia/Ulaanbaatar",     "North Asia East"},
+    {"Asia/Vladivostok",     "Vladivostok"},
+    {"Asia/Yakutsk",         "Yakutsk"},
+    {"Asia/Yekaterinburg",   "Ekaterinburg"},
+    {"Asia/Yerevan",         "Caucasus"},
+    {"Atlantic/Azores",      "Azores"},
+    {"Atlantic/Cape_Verde",  "Cape Verde"},
+    {"Australia/Adelaide",   "Cen. Australia"},
+    {"Australia/Brisbane",   "E. Australia"},
+    {"Australia/Darwin",     "AUS Central"},
+    {"Australia/Hobart",     "Tasmania"},
+    {"Australia/Perth",      "W. Australia"},
+    {"Australia/Sydney",     "AUS Eastern"},
+    {"Europe/Berlin",        "W. Europe"},
+    {"Europe/Helsinki",      "FLE"},
+    {"Europe/Istanbul",      "GTB"},
+    {"Europe/London",        "GMT"},
+    {"Europe/Minsk",         "E. Europe"},
+    {"Europe/Moscow",        "Russian"},
+    {"Europe/Paris",         "Romance"},
+    {"Europe/Prague",        "Central Europe"},
+    {"Europe/Warsaw",        "Central European"},
+    {"Pacific/Apia",         "Samoa"},
+    {"Pacific/Auckland",     "New Zealand"},
+    {"Pacific/Fiji",         "Fiji"},
+    {"Pacific/Guadalcanal",  "Central Pacific"},
+    {"Pacific/Guam",         "West Pacific"},
+    {"Pacific/Honolulu",     "Hawaiian"},
+    {"Pacific/Kwajalein",    "Dateline"},
+    {"Pacific/Tongatapu",    "Tonga"}
+};
+#endif
+
+/* NOTE: Some Windows zone ids appear more than once. In such cases the
+ * ICU zone id from the first one is the preferred match.
  */
 static const WindowsICUMap ZONE_MAP[] = {
-    {"Etc/GMT+12",           "Dateline"}, /* S (GMT-12:00) International Date Line West */
+    /* S (GMT-12:00) International Date Line West */
+    {"Etc/GMT+12",                  "Dateline"},
+
+    /* S (GMT-11:00) Midway Island, Samoa */
+    {"Pacific/Apia",                "Samoa"},
+    {"Pacific/Midway",              "Samoa"},
+
+    /* S (GMT-10:00) Hawaii */
+    {"Pacific/Honolulu",            "Hawaiian"},
+
+    /* D (GMT-09:00) Alaska */
+    {"America/Anchorage",           "Alaskan"},
+    {"America/Juneau",              "Alaskan"},
+    {"America/Yakutat",             "Alaskan"},
+    {"America/Nome",                "Alaskan"},
+
+    /* D (GMT-08:00) Pacific Time (US & Canada) */
+    {"America/Los_Angeles",         "Pacific"},
+    {"America/Dawson",              "Pacific"},
+    {"America/Vancouver",           "Pacific"},
+    {"America/Whitehorse",          "Pacific"},
+
+    /* D (GMT-08:00) Tijuana, Baja California */
+    {"America/Tijuana",             "Pacific Standard Time (Mexico)"},
+
+    /* D (GMT-07:00) Mountain Time (US & Canada) */
+    {"America/Denver",              "Mountain"},
+    {"America/Boise",               "Mountain"},
+    {"America/Cambridge_Bay",       "Mountain"},
+    {"America/Edmonton",            "Mountain"},
+    {"America/Inuvik",              "Mountain"},
+    {"America/Shiprock",            "Mountain"},
+    {"America/Yellowknife",         "Mountain"},
+
+    /* S (GMT-07:00) Arizona */
+    {"America/Phoenix",             "US Mountain"},
+
+    /* D (GMT-07:00) Chihuahua, La Paz, Mazatlan */
+    {"America/Chihuahua",           "Mountain Standard Time (Mexico)"},
+    {"America/Mazatlan",            "Mountain Standard Time (Mexico)"},
+
+    /* D (GMT-06:00) Central Time (US & Canada) */
+    {"America/Chicago",             "Central"},
+    {"America/Indiana/Knox",        "Central"},
+    {"America/Indiana/Tell_City",   "Central"},
+    {"America/Menominee",           "Central"},
+    {"America/North_Dakota/Center", "Central"},
+    {"America/North_Dakota/New_Salem",      "Central"},
+    {"America/Rainy_River",         "Central"},
+    {"America/Rankin_Inlet",        "Central"},
+    {"America/Winnipeg",            "Central"},
+
+    /* D (GMT-06:00) Guadalajara, Mexico City, Monterrey */
+    {"America/Mexico_City",         "Central Standard Time (Mexico)"},
+    {"America/Monterrey",           "Central Standard Time (Mexico)"},
+
+    /* S (GMT-06:00) Central America */
+    {"America/Guatemala",           "Central America"},
+    {"America/Belize",              "Central America"},
+    {"America/Costa_Rica",          "Central America"},
+    {"America/El_Salvador",         "Central America"},
+    {"America/Managua",             "Central America"},
+    {"America/Tegucigalpa",         "Central America"},
+    {"Pacific/Galapagos",           "Central America"},
+
+    /* S (GMT-06:00) Saskatchewan */
+    {"America/Regina",              "Canada Central"},
+    {"America/Swift_Current",       "Canada Central"},
+
+    /* D (GMT-05:00) Eastern Time (US & Canada) */
+    {"America/New_York",            "Eastern"},
+    {"America/Detroit",             "Eastern"},
+    {"America/Grand_Turk",          "Eastern"},
+    {"America/Indiana/Marengo",     "Eastern"},
+    {"America/Indiana/Petersburg",  "Eastern"},
+    {"America/Indiana/Vevay",       "Eastern"},
+    {"America/Indiana/Vincennes",   "Eastern"},
+    {"America/Indiana/Winamac",     "Eastern"},
+    {"America/Indianapolis",        "Eastern"},
+    {"America/Iqaluit",             "Eastern"},
+    {"America/Kentucky/Monticello", "Eastern"},
+    {"America/Louisville",          "Eastern"},
+    {"America/Montreal",            "Eastern"},
+    {"America/Nassau",              "Eastern"},
+    {"America/Nipigon",             "Eastern"},
+    {"America/Pangnirtung",         "Eastern"},
+    {"America/Thunder_Bay",         "Eastern"},
+    {"America/Toronto",             "Eastern"},
+
+    /* S (GMT-05:00) Bogota, Lima, Quito, Rio Branco */
+    {"America/Bogota",              "SA Pacific"},
+    {"America/Lima",                "SA Pacific"},
+    {"America/Guayaquil",           "SA Pacific"},
+    {"America/Rio_Branco",          "SA Pacific"},
+
+    /* S (GMT-05:00) Indiana (East) */
+    {"Etc/GMT+5",                   "US Eastern"},
+
+    /* S (GMT-04:30) Caracas */
+    {"America/Caracas",             "Venezuela"},
+
+    /* D (GMT-04:00) Atlantic Time (Canada) */
+    {"America/Halifax",             "Atlantic"},
+    {"America/Glace_Bay",           "Atlantic"},
+    {"America/Moncton",             "Atlantic"},
+
+    /* D (GMT-04:00) Santiago */
+    {"America/Santiago",            "Pacific SA"},
+
+    /* D (GMT-04:00) Manaus */ /* MS bug - DST is not used */
+    {"America/Manaus",              "Central Brazilian"}, 
+
+    /* S (GMT-04:00) La Paz */
+    {"America/La_Paz",              "SA Western"}, 
+
+    /* D (GMT-03:30) Newfoundland */
+    {"America/St_Johns",            "Newfoundland"},
+
+    /* D (GMT-03:00) Brasilia */
+    {"America/Sao_Paulo",           "E. South America"},
+
+    /* D (GMT-03:00) Buenos Aires */
+    {"America/Buenos_Aires",        "Argentina"}, 
+
+    /* D (GMT-03:00) Greenland */
+    {"America/Godthab",             "Greenland"},
+
+    /* D (GMT-03:00) Montevideo */
+    {"America/Montevideo",          "Montevideo"},
+
+    /* S (GMT-03:00) Georgetown */ /* MS bug - Georgetown uses GMT-04:00 */
+    {"Etc/GMT+3",                   "SA Eastern"}, 
+
+    /* D (GMT-02:00) Mid-Atlantic */ /* MS bug - There is no such zone using GMT-02:00 with DST */
+    {"America/South_Georgia",       "Mid-Atlantic"},
+    {"America/Noronha",             "Mid-Atlantic"},
+
+    /* D (GMT-01:00) Azores */
+    {"Atlantic/Azores",             "Azores"},
+
+    /* S (GMT-01:00) Cape Verde Is. */
+    {"Atlantic/Cape_Verde",         "Cape Verde"},
+
+    /* D (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London */
+    {"Europe/London",               "GMT"},
+    {"Europe/Dublin",               "GMT"},
+    {"Europe/Lisbon",               "GMT"},
+
+    /* S (GMT) Casablanca, Monrovia, Reykjavik */
+    {"Africa/Casablanca",           "Greenwich"},
+    {"Africa/Monrovia",             "Greenwich"},
+    {"Atlantic/Reykjavik",          "Greenwich"},
+
+    /* D (GMT+01:00) Brussels, Copenhagen, Madrid, Paris */
+    {"Europe/Paris",                "Romance"},
+    {"Europe/Brussels",             "Romance"},
+    {"Europe/Copenhagen",           "Romance"},
+    {"Europe/Madrid",               "Romance"},
+
+    /* D (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna */
+    {"Europe/Berlin",               "W. Europe"},
+    {"Europe/Amsterdam",            "W. Europe"},
+    {"Europe/Zurich",               "W. Europe"},
+    {"Europe/Rome",                 "W. Europe"},
+    {"Europe/Stockholm",            "W. Europe"},
+    {"Europe/Vienna",               "W. Europe"},
+
+    /* D (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague */
+    {"Europe/Budapest",             "Central Europe"}, 
+    {"Europe/Belgrade",             "Central Europe"}, 
+    {"Europe/Bratislava",           "Central Europe"}, 
+    {"Europe/Ljubljana",            "Central Europe"}, 
+    {"Europe/Prague",               "Central Europe"}, 
+
+    /* D (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb */
+    {"Eurpoe/Warsaw",               "Central European"},
+    {"Eurpoe/Sarajevo",             "Central European"},
+    {"Eurpoe/Skopje",               "Central European"},
+    {"Eurpoe/Zagreb",               "Central European"},
+
+    /* S (GMT+01:00) West Central Africa */
+    {"Africa/Lagos",                "W. Central Africa"},
+    {"Africa/Luanda",               "W. Central Africa"},
+    {"Africa/Porto-Novo",           "W. Central Africa"},
+    {"Africa/Douala",               "W. Central Africa"},
+    {"Africa/Bangui",               "W. Central Africa"},
+    {"Africa/Ndjamena",             "W. Central Africa"},
+    {"Africa/Kinshasa",             "W. Central Africa"},
+    {"Africa/Brazzaville",          "W. Central Africa"},
+    {"Africa/Malabo",               "W. Central Africa"},
+    {"Africa/Libreville",           "W. Central Africa"},
+    {"Africa/Niamey",               "W. Central Africa"},
+
+    /* D (GMT+02:00) Athens, Bucharest, Istanbul */
+    {"Europe/Istanbul",             "GTB"},
+    {"Europe/Athens",               "GTB"},
+    {"Europe/Bucharest",            "GTB"},
+
+    /* D (GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius */
+    {"Europe/Kiev",                 "FLE"},
+    {"Europe/Helsinki",             "FLE"},
+    {"Europe/Riga",                 "FLE"},
+    {"Europe/Sofia",                "FLE"},
+    {"Europe/Tallinn",              "FLE"},
+    {"Europe/Vilnius",              "FLE"},
+
+    /* D (GMT+02:00) Jerusalem */
+    {"Asia/Jerusalem",              "Israel"},
+
+    /* D (GMT+02:00) Minsk */
+    {"Europe/Minsk",                "E. Europe"}, 
+
+    /* D (GMT+02:00) Cairo */
+    {"Africa/Cairo",                "Egypt"},
+
+    /* D (GMT+02:00) Amman */
+    {"Asia/Amman",                  "Jordan"},
+
+    /* D (GMT+02:00) Beirut */
+    {"Asia/Beirut",                 "Middle East"},
+
+    /* D (GMT+02:00) Windhoek */
+    {"Africa/Windhoek",             "Namibia"},
+
+    /* S (GMT+02:00) Harare, Pretoria */
+    {"Africa/Johannesburg",         "South Africa"},
+    {"Africa/Harare",               "South Africa"},
 
-    {"Pacific/Apia",         "Samoa"}, /* S (GMT-11:00) Midway Island, Samoa */
+    /* D (GMT+03:00) Moscow, St. Petersburg, Volgograd */
+    {"Europe/Moscow",               "Russian"},
+    {"Europe/Volgograd",            "Russian"},
 
-    {"Pacific/Honolulu",     "Hawaiian"}, /* S (GMT-10:00) Hawaii */
+    /* D (GMT+03:00) Baghdad */
+    {"Asia/Baghdad",                "Arabic"},
 
-    {"America/Anchorage",    "Alaskan"}, /* D (GMT-09:00) Alaska */
+    /* S (GMT+03:00) Kuwait, Riyadh */
+    {"Asia/Riyadh",                 "Arab"},
+    {"Asia/Kuwait",                 "Arab"},
 
-    {"America/Los_Angeles",  "Pacific"}, /* D (GMT-08:00) Pacific Time (US & Canada); Tijuana */
+    /* S (GMT+03:00) Nairobi */
+    {"Africa/Nairobi",              "E. Africa"},
 
-    {"America/Phoenix",      "US Mountain"}, /* S (GMT-07:00) Arizona */
-    {"America/Denver",       "Mountain"}, /* D (GMT-07:00) Mountain Time (US & Canada) */
-    {"America/Chihuahua",    "Mexico Standard Time 2"}, /* D (GMT-07:00) Chihuahua, La Paz, Mazatlan */
+    /* S (GMT+03:00) Tbilisi */ /* MS bug - Tbilisi uses GMT+04:00 */
+    {"Etc/GMT-3",                   "Georgian"},
 
-    {"America/Managua",      "Central America"}, /* S (GMT-06:00) Central America */
-    {"America/Regina",       "Canada Central"}, /* S (GMT-06:00) Saskatchewan */
-    {"America/Mexico_City",  "Mexico"}, /* D (GMT-06:00) Guadalajara, Mexico City, Monterrey */
-    {"America/Chicago",      "Central"}, /* D (GMT-06:00) Central Time (US & Canada) */
+    /* D (GMT+03:30) Tehran */
+    {"Asia/Tehran",                 "Iran"},
 
-    {"America/Indianapolis", "US Eastern"}, /* S (GMT-05:00) Indiana (East) */
-    {"America/Bogota",       "SA Pacific"}, /* S (GMT-05:00) Bogota, Lima, Quito */
-    {"America/New_York",     "Eastern"}, /* D (GMT-05:00) Eastern Time (US & Canada) */
+    /* D (GMT+04:00) Yerevan */
+    {"Asia/Yerevan",                "Armenian"}, 
 
-    {"America/Caracas",      "SA Western"}, /* S (GMT-04:00) Caracas, La Paz */
-    {"America/Santiago",     "Pacific SA"}, /* D (GMT-04:00) Santiago */
-    {"America/Halifax",      "Atlantic"}, /* D (GMT-04:00) Atlantic Time (Canada) */
+    /* D (GMT+04:00) Baku */
+    {"Asia/Baku",                   "Azerbaijan"}, 
 
-    {"America/St_Johns",     "Newfoundland"}, /* D (GMT-03:30) Newfoundland */
+    /* S (GMT+04:00) Abu Dhabi, Muscat */
+    {"Asia/Dubai",                  "Arabian"},
+    {"Asia/Muscat",                 "Arabian"},
 
-    {"America/Buenos_Aires", "SA Eastern"}, /* S (GMT-03:00) Buenos Aires, Georgetown */
-    {"America/Godthab",      "Greenland"}, /* D (GMT-03:00) Greenland */
-    {"America/Sao_Paulo",    "E. South America"}, /* D (GMT-03:00) Brasilia */
+    /* S (GMT+04:00) Caucasus Standard Time */
+    {"Asia/Tbilisi",                "Caucasus"},
 
-    {"America/Noronha",      "Mid-Atlantic"}, /* D (GMT-02:00) Mid-Atlantic */
+    /* S (GMT+04:30) Kabul */
+    {"Asia/Kabul",                  "Afghanistan"},
 
-    {"Atlantic/Cape_Verde",  "Cape Verde"}, /* S (GMT-01:00) Cape Verde Is. */
-    {"Atlantic/Azores",      "Azores"}, /* D (GMT-01:00) Azores */
+    /* D (GMT+05:00) Ekaterinburg */
+    {"Asia/Yekaterinburg",          "Ekaterinburg"},
 
-    {"Africa/Casablanca",    "Greenwich"}, /* S (GMT) Casablanca, Monrovia */
-    {"Europe/London",        "GMT"}, /* D (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London */
+    /* S (GMT+05:00) Islamabad, Karachi, Tashkent */
+    {"Asia/Karachi",                "West Asia"},
+    {"Asia/Tashkent",               "West Asia"},
 
-    {"Africa/Lagos",         "W. Central Africa"}, /* S (GMT+01:00) West Central Africa */
-    {"Europe/Berlin",        "W. Europe"}, /* D (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna */
-    {"Europe/Paris",         "Romance"}, /* D (GMT+01:00) Brussels, Copenhagen, Madrid, Paris */
-    {"Europe/Sarajevo",      "Central European"}, /* D (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb */
-    {"Europe/Belgrade",      "Central Europe"}, /* D (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague */
+    /* S (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi */
+    {"Asia/Calcutta",               "India"}, 
 
-    {"Africa/Johannesburg",  "South Africa"}, /* S (GMT+02:00) Harare, Pretoria */
-    {"Asia/Jerusalem",       "Israel"}, /* S (GMT+02:00) Jerusalem */
-    {"Europe/Istanbul",      "GTB"}, /* D (GMT+02:00) Athens, Istanbul, Minsk */
-    {"Europe/Helsinki",      "FLE"}, /* D (GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius */
-    {"Africa/Cairo",         "Egypt"}, /* D (GMT+02:00) Cairo */
-    {"Europe/Bucharest",     "E. Europe"}, /* D (GMT+02:00) Bucharest */
+    /* S (GMT+05:30) Sri Jayawardenepura */
+    {"Asia/Colombo",                "Sri Lanka"}, 
 
-    {"Africa/Nairobi",       "E. Africa"}, /* S (GMT+03:00) Nairobi */
-    {"Asia/Riyadh",          "Arab"}, /* S (GMT+03:00) Kuwait, Riyadh */
-    {"Europe/Moscow",        "Russian"}, /* D (GMT+03:00) Moscow, St. Petersburg, Volgograd */
-    {"Asia/Baghdad",         "Arabic"}, /* D (GMT+03:00) Baghdad */
+    /* S (GMT+05:45) Kathmandu */
+    {"Asia/Katmandu",               "Nepal"},
 
-    {"Asia/Tehran",          "Iran"}, /* D (GMT+03:30) Tehran */
+    /* D (GMT+06:00) Almaty, Novosibirsk */ /* No DST in Almaty */
+    {"Asia/Novosibirsk",            "N. Central Asia"}, 
 
-    {"Asia/Muscat",          "Arabian"}, /* S (GMT+04:00) Abu Dhabi, Muscat */
-    {"Asia/Tbilisi",         "Caucasus"}, /* D (GMT+04:00) Baku, Tbilisi, Yerevan */
+    /* S (GMT+06:00) Astana, Dhaka */
+    {"Asia/Dhaka",                  "Central Asia"},
+    {"Asia/Almaty",                 "Central Asia"},
+    {"Asia/Qyzylorda",              "Central Asia"},
 
-    {"Asia/Kabul",           "Afghanistan"}, /* S (GMT+04:30) Kabul */
+    /* S (GMT+06:30) Yangon (Rangoon) */
+    {"Asia/Rangoon",                "Myanmar"},
 
-    {"Asia/Karachi",         "West Asia"}, /* S (GMT+05:00) Islamabad, Karachi, Tashkent */
-    {"Asia/Yekaterinburg",   "Ekaterinburg"}, /* D (GMT+05:00) Ekaterinburg */
+    /* D (GMT+07:00) Krasnoyarsk */
+    {"Asia/Krasnoyarsk",            "North Asia"},
 
-    {"Asia/Calcutta",        "India"}, /* S (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi */
+    /* S (GMT+07:00) Bangkok, Hanoi, Jakarta */
+    {"Asia/Bangkok",                "SE Asia"},
+    {"Asia/Saigon",                 "SE Asia"},
+    {"Asia/Jakarta",                "SE Asia"},
 
-    {"Asia/Katmandu",        "Nepal"}, /* S (GMT+05:45) Kathmandu */
+    /* D (GMT+08:00) Irkutsk, Ulaan Bataar */ /* Ulaan Bataar does not use DST */
+    {"Asia/Irkutsk",                "North Asia East"},
 
-    {"Asia/Colombo",         "Sri Lanka"}, /* S (GMT+06:00) Sri Jayawardenepura */
-    {"Asia/Dhaka",           "Central Asia"}, /* S (GMT+06:00) Astana, Dhaka */
-    {"Asia/Novosibirsk",     "N. Central Asia"}, /* D (GMT+06:00) Almaty, Novosibirsk */
+    /* D (GMT+08:00) Perth */
+    {"Australia/Perth",             "W. Australia"},
 
-    {"Asia/Rangoon",         "Myanmar"}, /* S (GMT+06:30) Rangoon */
+    /* S (GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi */
+    {"Asia/Shanghai",               "China"},
+    {"Asia/Chongqing",              "China"},
+    {"Asia/Hong_Kong",              "China"},
+    {"Asia/Urumqi",                 "China"},
 
-    {"Asia/Bangkok",         "SE Asia"}, /* S (GMT+07:00) Bangkok, Hanoi, Jakarta */
-    {"Asia/Krasnoyarsk",     "North Asia"}, /* D (GMT+07:00) Krasnoyarsk */
+    /* S (GMT+08:00) Taipei */
+    {"Asia/Taipei",                 "Taipei"},
 
-    {"Australia/Perth",      "W. Australia"}, /* S (GMT+08:00) Perth */
-    {"Asia/Taipei",          "Taipei"}, /* S (GMT+08:00) Taipei */
-    {"Asia/Singapore",       "Singapore"}, /* S (GMT+08:00) Kuala Lumpur, Singapore */
-    {"Asia/Hong_Kong",       "China"}, /* S (GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi */
-    {"Asia/Irkutsk",         "North Asia East"}, /* D (GMT+08:00) Irkutsk, Ulaan Bataar */
+    /* S (GMT+08:00) Kuala Lumpur, Singapore */
+    {"Asia/Singapore",              "Singapore"},
+    {"Asia/Kuala_Lumpur",           "Singapore"},
 
-    {"Asia/Tokyo",           "Tokyo"}, /* S (GMT+09:00) Osaka, Sapporo, Tokyo */
-    {"Asia/Seoul",           "Korea"}, /* S (GMT+09:00) Seoul */
-    {"Asia/Yakutsk",         "Yakutsk"}, /* D (GMT+09:00) Yakutsk */
+    /* D (GMT+09:00) Yakutsk */
+    {"Asia/Yakutsk",                "Yakutsk"}, 
 
-    {"Australia/Darwin",     "AUS Central"}, /* S (GMT+09:30) Darwin */
-    {"Australia/Adelaide",   "Cen. Australia"}, /* D (GMT+09:30) Adelaide */
+    /* S (GMT+09:00) Osaka, Sapporo, Tokyo */
+    {"Asia/Tokyo",                  "Tokyo"},
 
-    {"Pacific/Guam",         "West Pacific"}, /* S (GMT+10:00) Guam, Port Moresby */
-    {"Australia/Brisbane",   "E. Australia"}, /* S (GMT+10:00) Brisbane */
-    {"Asia/Vladivostok",     "Vladivostok"}, /* D (GMT+10:00) Vladivostok */
-    {"Australia/Hobart",     "Tasmania"}, /* D (GMT+10:00) Hobart */
-    {"Australia/Sydney",     "AUS Eastern"}, /* D (GMT+10:00) Canberra, Melbourne, Sydney */
+    /* S (GMT+09:00) Seoul */
+    {"Asia/Seoul",                  "Korea"},
 
-    {"Asia/Magadan",         "Central Pacific"}, /* S (GMT+11:00) Magadan, Solomon Is., New Caledonia */
+    /* D (GMT+09:30) Adelaide */
+    {"Australia/Adelaide",          "Cen. Australia"},
 
-    {"Pacific/Fiji",         "Fiji"}, /* S (GMT+12:00) Fiji, Kamchatka, Marshall Is. */
-    {"Pacific/Auckland",     "New Zealand"}, /* D (GMT+12:00) Auckland, Wellington */
+    /* S (GMT+09:30) Darwin */
+    {"Australia/Darwin",            "AUS Central"},
 
-    {"Pacific/Tongatapu",    "Tonga"}, /* S (GMT+13:00) Nuku'alofa */
-    NULL,                    NULL
+    /* D (GMT+10:00) Canberra, Melbourne, Sydney */
+    {"Australia/Sydney",            "AUS Eastern"},
+    {"Australia/Melbourne",         "AUS Eastern"},
+
+    /* D (GMT+10:00) Hobart */
+    {"Australia/Hobart",            "Tasmania"},
+
+    /* D (GMT+10:00) Vladivostok */
+    {"Asia/Vladivostok",            "Vladivostok"},
+
+    /* S (GMT+10:00) Brisbane */
+    {"Australia/Brisbane",          "E. Australia"},
+
+    /* S (GMT+10:00) Guam, Port Moresby */
+    {"Pacific/Port_Moresby",        "West Pacific"},
+    {"Pacific/Guam",                "West Pacific"},
+
+    /* S (GMT+11:00) Magadan, Solomon Is., New Caledonia */ /* Magadan uses DST */
+    {"Pacific/Guadalcanal",         "Central Pacific"},
+    {"Pacific/Noumea",              "Central Pacific"},
+
+    /* D (GMT+12:00) Auckland, Wellington */
+    {"Pacific/Auckland",            "New Zealand"},
+
+    /* S (GMT+12:00) Fiji, Kamchatka, Marshall Is. */
+    {"Pacific/Fiji",                "Fiji"},
+    {"Pacific/Majuro",              "Fiji"},
+    {"Pacific/Kwajalein",           "Fiji"},
+
+    /* S (GMT+13:00) Nuku'alofa */
+    {"Pacific/Tongatapu",           "Tonga"},
+
+    NULL,                           NULL
 };
 
 /**
@@ -225,19 +573,21 @@ static const WindowsICUMap ZONE_MAP[] = {
  * append a " Standard Time" if appropriate.
  */
 static const WindowsZoneRemap ZONE_REMAP[] = {
-    "Central European",     "-Warsaw",
-    "Central Europe",       "-Prague Bratislava",
-    "China",                "-Beijing",
-                                               
-    "Greenwich",            "+GMT",
-    "GTB",                  "+GFT",
-    "Arab",                 "+Saudi Arabia",
-    "SE Asia",              "+Bangkok",
-    "AUS Eastern",          "+Sydney",
+    "Central European",                "-Warsaw",
+    "Central Europe",                  "-Prague Bratislava",
+    "China",                           "-Beijing",
+
+    "Greenwich",                       "+GMT",
+    "GTB",                             "+GFT",
+    "Arab",                            "+Saudi Arabia",
+    "SE Asia",                         "+Bangkok",
+    "AUS Eastern",                     "+Sydney",
+    "Mountain Standard Time (Mexico)", "-Mexico Standard Time 2",
+    "Central Standard Time (Mexico)",  "+Mexico",
     NULL,                   NULL,
 };
 
-static int32_t fWinType = -1;
+static int32_t gWinType = 0;
 
 static int32_t detectWindowsType()
 {
@@ -250,8 +600,8 @@ static int32_t detectWindowsType()
         really want to know is how the registry is laid out.
         Specifically, is it 9x/Me or not, and is it "GMT" or "GMT
         Standard Time". */
-    for (winType = 0; winType < 2; winType += 1) {
-        result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+    for (winType = 0; winType < 2; winType++) {
+        result = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
                               WIN_TYPE_PROBE_REGKEY[winType],
                               0,
                               KEY_QUERY_VALUE,
@@ -263,7 +613,7 @@ static int32_t detectWindowsType()
         }
     }
 
-    return winType;
+    return winType+1; // +1 to bring it inline with the enum
 }
 
 /*
@@ -308,22 +658,24 @@ static LONG openTZRegKey(HKEY *hkey, const char *winid)
     char *name;
     LONG result;
 
-    /* TODO: This isn't thread safe, but it's probably good enough. */
-    if (fWinType < 0) {
-        fWinType = detectWindowsType();
+    /* This isn't thread safe, but it's good enough because the result should be constant per system. */
+    if (gWinType <= 0) {
+        gWinType = detectWindowsType();
     }
 
-    uprv_strcpy(subKeyName, TZ_REGKEY[(fWinType == WIN_9X_ME_TYPE) ? 0 : 1]);
+    uprv_strcpy(subKeyName, TZ_REGKEY[(gWinType != WIN_9X_ME_TYPE)]);
     name = &subKeyName[strlen(subKeyName)];
     uprv_strcat(subKeyName, winid);
 
-    if (fWinType != WIN_9X_ME_TYPE &&
+    if (gWinType != WIN_9X_ME_TYPE &&
         (winid[strlen(winid) - 1] != '2') &&
-        !(fWinType == WIN_NT_TYPE && strcmp(winid, "GMT") == 0)) {
+        (winid[strlen(winid) - 1] != ')') &&
+        !(gWinType == WIN_NT_TYPE && strcmp(winid, "GMT") == 0))
+    {
         uprv_strcat(subKeyName, STANDARD_TIME_REGKEY);
     }
 
-    result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+    result = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
                             subKeyName,
                             0,
                             KEY_QUERY_VALUE,
@@ -337,10 +689,10 @@ static LONG openTZRegKey(HKEY *hkey, const char *winid)
         for (i=0; ZONE_REMAP[i].winid; i++) {
             if (uprv_strcmp(winid, ZONE_REMAP[i].winid) == 0) {
                 uprv_strcpy(name, ZONE_REMAP[i].altwinid + 1);
-                if (*(ZONE_REMAP[i].altwinid) == '+' && fWinType != WIN_9X_ME_TYPE) {
-                    uprv_strcat(subKeyName, STANDARD_TIME_REGKEY);                
+                if (*(ZONE_REMAP[i].altwinid) == '+' && gWinType != WIN_9X_ME_TYPE) {
+                    uprv_strcat(subKeyName, STANDARD_TIME_REGKEY);
                 }
-                return RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+                return RegOpenKeyExA(HKEY_LOCAL_MACHINE,
                                       subKeyName,
                                       0,
                                       KEY_QUERY_VALUE,
@@ -361,7 +713,7 @@ static LONG getTZI(const char *winid, TZI *tzi)
     result = openTZRegKey(&hkey, winid);
 
     if (result == ERROR_SUCCESS) {
-        result = RegQueryValueEx(hkey,
+        result = RegQueryValueExA(hkey,
                                     TZI_REGKEY,
                                     NULL,
                                     NULL,
@@ -381,7 +733,7 @@ uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid,
     const char *winid;
     TZI tzi;
     LONG result;
-    
+
     winid = findWindowsZoneID(icuid, length);
 
     if (winid != NULL) {
@@ -453,7 +805,7 @@ uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid,
  * Main Windows time zone detection function.  Returns the Windows
  * time zone, translated to an ICU time zone, or NULL upon failure.
  */
-U_CAPI const char* U_EXPORT2
+U_CFUNC const char* U_EXPORT2
 uprv_detectWindowsTimeZone() {
     LONG result;
     HKEY hkey;
@@ -515,7 +867,7 @@ uprv_detectWindowsTimeZone() {
     if (firstMatch < 0) {
         return NULL;
     }
-    
+
     if (firstMatch != lastMatch) {
         char stdName[32];
         DWORD stdNameSize;
@@ -527,15 +879,15 @@ uprv_detectWindowsTimeZone() {
            (not the API). This avoids conversion issues.  Use the
            standard name, since Windows modifies the daylight name to
            match the standard name if there is no DST. */
-        if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+        if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
                               CURRENT_ZONE_REGKEY,
                               0,
                               KEY_QUERY_VALUE,
                               &hkey) == ERROR_SUCCESS)
         {
             stdNameSize = sizeof(stdName);
-            result = RegQueryValueEx(hkey,
-                                     (LPTSTR)STANDARD_NAME_REGKEY,
+            result = RegQueryValueExA(hkey,
+                                     STANDARD_NAME_REGKEY,
                                      NULL,
                                      NULL,
                                      (LPBYTE)stdName,
@@ -552,8 +904,8 @@ uprv_detectWindowsTimeZone() {
                 result = openTZRegKey(&hkey, ZONE_MAP[j].winid);
 
                 if (result == ERROR_SUCCESS) {
-                    result = RegQueryValueEx(hkey,
-                                             (LPTSTR)STD_REGKEY,
+                    result = RegQueryValueExA(hkey,
+                                             STD_REGKEY,
                                              NULL,
                                              NULL,
                                              (LPBYTE)stdRegName,