]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/dtfmtsym.cpp
ICU-64260.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / dtfmtsym.cpp
index b710170916f48e9ee7754ab5c0f1c5e31d4d9ed7..93105e0fe0fab585eb9482e180b9ef2bde879e07 100644 (file)
@@ -1,6 +1,8 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
-* Copyright (C) 1997-2006, International Business Machines Corporation and    *
+* Copyright (C) 1997-2016, International Business Machines Corporation and    *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 *
 *   10/12/05    emmons      Added setters for eraNames, month/day by width/context
 *******************************************************************************
 */
+
+#include <utility>
+
 #include "unicode/utypes.h"
 
 #if !UCONFIG_NO_FORMATTING
-
+#include "unicode/ustring.h"
+#include "unicode/localpointer.h"
 #include "unicode/dtfmtsym.h"
 #include "unicode/smpdtfmt.h"
+#include "unicode/msgfmt.h"
+#include "unicode/numsys.h"
+#include "unicode/tznames.h"
 #include "cpputils.h"
-#include "ucln_in.h"
-#include "mutex.h"
+#include "umutex.h"
 #include "cmemory.h"
 #include "cstring.h"
+#include "charstr.h"
+#include "dt_impl.h"
 #include "locbased.h"
 #include "gregoimp.h"
 #include "hash.h"
-#include "uresimp.h" 
+#include "uassert.h"
+#include "uresimp.h"
+#include "ureslocs.h"
+#include "uvector.h"
+#include "shareddateformatsymbols.h"
+#include "unicode/calendar.h"
+#include "unifiedcache.h"
 
 // *****************************************************************************
 // class DateFormatSymbols
 // *****************************************************************************
+
 /**
  * These are static arrays we use only in the case where we have no
  * resource data.
  */
 
-#define PATTERN_CHARS_LEN 26
+#if UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR
+#define PATTERN_CHARS_LEN 38
+#else
+#define PATTERN_CHARS_LEN 37
+#endif
 
 /**
  * Unlocalized date-time pattern characters. For example: 'y', 'd', etc. All
  * locales use the same these unlocalized pattern characters.
  */
 static const UChar gPatternChars[] = {
-    // GyMdkHmsSEDFwWahKzYeugAZvcLQq
+    // if UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR:
+    //   GyMdkHmsSEDFwWahKzYeugAZvcLQqVUOXxrbB:
+    // else:
+    //   GyMdkHmsSEDFwWahKzYeugAZvcLQqVUOXxrbB
+
     0x47, 0x79, 0x4D, 0x64, 0x6B, 0x48, 0x6D, 0x73, 0x53, 0x45,
     0x44, 0x46, 0x77, 0x57, 0x61, 0x68, 0x4B, 0x7A, 0x59, 0x65,
-    0x75, 0x67, 0x41, 0x5A, 0x76, 0x63, 0x4c, 0x51, 0x71, 0
+    0x75, 0x67, 0x41, 0x5A, 0x76, 0x63, 0x4c, 0x51, 0x71, 0x56,
+    0x55, 0x4F, 0x58, 0x78, 0x72, 0x62, 0x42,
+#if UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR
+    0x3a,
+#endif
+    0
 };
 
-/* length of an array */
-#define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0]))
-
 //------------------------------------------------------
 // Strings of last resort.  These are only used if we have no resource
 // files.  They aren't designed for actual use, just for backup.
@@ -117,19 +143,6 @@ static const UChar gLastResortEras[2][3] =
     {0x0041, 0x0044, 0x0000}  /* "AD" */
 };
 
-
-// These are the zone strings of last resort.
-static const UChar gLastResortZoneStrings[7][4] =
-{
-    {0x0047, 0x004D, 0x0054, 0x0000}, /* "GMT" */
-    {0x0047, 0x004D, 0x0054, 0x0000}, /* "GMT" */
-    {0x0047, 0x004D, 0x0054, 0x0000}, /* "GMT" */
-    {0x0047, 0x004D, 0x0054, 0x0000}, /* "GMT" */
-    {0x0047, 0x004D, 0x0054, 0x0000}, /* "GMT" */
-    {0x0047, 0x004D, 0x0054, 0x0000}, /* "GMT" */
-    {0x0047, 0x004D, 0x0054, 0x0000}  /* "GMT" */
-};
-
 /* Sizes for the last resort string arrays */
 typedef enum LastResortSize {
     kMonthNum = 13,
@@ -148,48 +161,79 @@ typedef enum LastResortSize {
     kEraLen = 3,
 
     kZoneNum = 5,
-    kZoneLen = 4
+    kZoneLen = 4,
+
+    kGmtHourNum = 4,
+    kGmtHourLen = 10
 } LastResortSize;
 
 U_NAMESPACE_BEGIN
 
+SharedDateFormatSymbols::~SharedDateFormatSymbols() {
+}
+
+template<> U_I18N_API
+const SharedDateFormatSymbols *
+        LocaleCacheKey<SharedDateFormatSymbols>::createObject(
+                const void * /*unusedContext*/, UErrorCode &status) const {
+    char type[256];
+    Calendar::getCalendarTypeFromLocale(fLoc, type, UPRV_LENGTHOF(type), status);
+    if (U_FAILURE(status)) {
+        return NULL;
+    }
+    SharedDateFormatSymbols *shared
+            = new SharedDateFormatSymbols(fLoc, type, status);
+    if (shared == NULL) {
+        status = U_MEMORY_ALLOCATION_ERROR;
+        return NULL;
+    }
+    if (U_FAILURE(status)) {
+        delete shared;
+        return NULL;
+    }
+    shared->addRef();
+    return shared;
+}
+
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(DateFormatSymbols)
 
+#define kSUPPLEMENTAL "supplementalData"
+
 /**
  * These are the tags we expect to see in normal resource bundle files associated
  * with a locale and calendar
  */
+static const char gCalendarTag[]="calendar";
+static const char gGregorianTag[]="gregorian";
 static const char gErasTag[]="eras";
-static const char gAbbreviatedTag[] = "abbreviated";
+static const char gCyclicNameSetsTag[]="cyclicNameSets";
+static const char gNameSetYearsTag[]="years";
+static const char gNameSetZodiacsTag[]="zodiacs";
 static const char gMonthNamesTag[]="monthNames";
+static const char gMonthPatternsTag[]="monthPatterns";
 static const char gDayNamesTag[]="dayNames";
 static const char gNamesWideTag[]="wide";
 static const char gNamesAbbrTag[]="abbreviated";
+static const char gNamesShortTag[]="short";
 static const char gNamesNarrowTag[]="narrow";
+static const char gNamesAllTag[]="all";
+static const char gNamesFormatTag[]="format";
 static const char gNamesStandaloneTag[]="stand-alone";
+static const char gNamesNumericTag[]="numeric";
 static const char gAmPmMarkersTag[]="AmPmMarkers";
+static const char gAmPmMarkersAbbrTag[]="AmPmMarkersAbbr";
+static const char gAmPmMarkersNarrowTag[]="AmPmMarkersNarrow";
 static const char gQuartersTag[]="quarters";
+static const char gNumberElementsTag[]="NumberElements";
+static const char gSymbolsTag[]="symbols";
+static const char gTimeSeparatorTag[]="timeSeparator";
+static const char gDayPeriodTag[]="dayPeriod";
 
-/**
- * These are the tags we expect to see in time zone data resource bundle files
- * associated with a locale.
- */
-static const char gZoneStringsTag[]="zoneStrings";
-static const char gLocalPatternCharsTag[]="localPatternChars";
+// static const char gZoneStringsTag[]="zoneStrings";
 
-static UMTX LOCK;
+// static const char gLocalPatternCharsTag[]="localPatternChars";
 
-/*
- * Keep this variable in synch with max length of display strings
- */
-#define UTZ_MAX_DISPLAY_STRINGS_LENGTH 7
-#define UTZ_SHORT_GENERIC   "sg"
-#define UTZ_SHORT_STANDARD  "ss"
-#define UTZ_SHORT_DAYLIGHT  "sd"
-#define UTZ_LONG_GENERIC    "lg"
-#define UTZ_LONG_STANDARD   "ls"
-#define UTZ_LONG_DAYLIGHT   "ld"
-#define UTZ_EXEMPLAR_CITY   "ec"
+static const char gContextTransformsTag[]="contextTransforms";
 
 /**
  * Jitterbug 2974: MSVC has a bug whereby new X[0] behaves badly.
@@ -199,14 +243,25 @@ static inline UnicodeString* newUnicodeStringArray(size_t count) {
     return new UnicodeString[count ? count : 1];
 }
 
-U_CDECL_BEGIN
-static void deleteUnicodeStringArray(void* obj) {
-    delete[] (UnicodeString*)obj;
-}
-U_CDECL_END
-
 //------------------------------------------------------
 
+DateFormatSymbols * U_EXPORT2
+DateFormatSymbols::createForLocale(
+        const Locale& locale, UErrorCode &status) {
+    const SharedDateFormatSymbols *shared = NULL;
+    UnifiedCache::getByLocale(locale, shared, status);
+    if (U_FAILURE(status)) {
+        return NULL;
+    }
+    DateFormatSymbols *result = new DateFormatSymbols(shared->get());
+    shared->removeRef();
+    if (result == NULL) {
+        status = U_MEMORY_ALLOCATION_ERROR;
+        return NULL;
+    }
+    return result;
+}
+
 DateFormatSymbols::DateFormatSymbols(const Locale& locale,
                                      UErrorCode& status)
     : UObject()
@@ -247,8 +302,8 @@ DateFormatSymbols::assignArray(UnicodeString*& dstArray,
                                const UnicodeString* srcArray,
                                int32_t srcCount)
 {
-    // assignArray() is only called by copyData(), which in turn implements the
-    // copy constructor and the assignment operator.
+    // assignArray() is only called by copyData() and initializeData(), which in turn
+    // implements the copy constructor and the assignment operator.
     // All strings in a DateFormatSymbols object are created in one of the following
     // three ways that all allow to safely use UnicodeString::fastCopyFrom():
     // - readonly-aliases from resource bundles
@@ -278,15 +333,30 @@ void
 DateFormatSymbols::createZoneStrings(const UnicodeString *const * otherStrings)
 {
     int32_t row, col;
+    UBool failed = FALSE;
 
     fZoneStrings = (UnicodeString **)uprv_malloc(fZoneStringsRowCount * sizeof(UnicodeString *));
-    for (row=0; row<fZoneStringsRowCount; ++row)
-    {
-        fZoneStrings[row] = newUnicodeStringArray(fZoneStringsColCount);
-        for (col=0; col<fZoneStringsColCount; ++col) {
-            // fastCopyFrom() - see assignArray comments
-            fZoneStrings[row][col].fastCopyFrom(otherStrings[row][col]);
+    if (fZoneStrings != NULL) {
+        for (row=0; row<fZoneStringsRowCount; ++row)
+        {
+            fZoneStrings[row] = newUnicodeStringArray(fZoneStringsColCount);
+            if (fZoneStrings[row] == NULL) {
+                failed = TRUE;
+                break;
+            }
+            for (col=0; col<fZoneStringsColCount; ++col) {
+                // fastCopyFrom() - see assignArray comments
+                fZoneStrings[row][col].fastCopyFrom(otherStrings[row][col]);
+            }
+        }
+    }
+    // If memory allocation failed, roll back and delete fZoneStrings
+    if (failed) {
+        for (int i = row; i >= 0; i--) {
+            delete[] fZoneStrings[i];
         }
+        uprv_free(fZoneStrings);
+        fZoneStrings = NULL;
     }
 }
 
@@ -295,8 +365,14 @@ DateFormatSymbols::createZoneStrings(const UnicodeString *const * otherStrings)
  */
 void
 DateFormatSymbols::copyData(const DateFormatSymbols& other) {
+    UErrorCode status = U_ZERO_ERROR;
+    U_LOCALE_BASED(locBased, *this);
+    locBased.setLocaleIDs(
+        other.getLocale(ULOC_VALID_LOCALE, status),
+        other.getLocale(ULOC_ACTUAL_LOCALE, status));
     assignArray(fEras, fErasCount, other.fEras, other.fErasCount);
     assignArray(fEraNames, fEraNamesCount, other.fEraNames, other.fEraNamesCount);
+    assignArray(fNarrowEras, fNarrowErasCount, other.fNarrowEras, other.fNarrowErasCount);
     assignArray(fMonths, fMonthsCount, other.fMonths, other.fMonthsCount);
     assignArray(fShortMonths, fShortMonthsCount, other.fShortMonths, other.fShortMonthsCount);
     assignArray(fNarrowMonths, fNarrowMonthsCount, other.fNarrowMonths, other.fNarrowMonthsCount);
@@ -305,37 +381,68 @@ DateFormatSymbols::copyData(const DateFormatSymbols& other) {
     assignArray(fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, other.fStandaloneNarrowMonths, other.fStandaloneNarrowMonthsCount);
     assignArray(fWeekdays, fWeekdaysCount, other.fWeekdays, other.fWeekdaysCount);
     assignArray(fShortWeekdays, fShortWeekdaysCount, other.fShortWeekdays, other.fShortWeekdaysCount);
+    assignArray(fShorterWeekdays, fShorterWeekdaysCount, other.fShorterWeekdays, other.fShorterWeekdaysCount);
     assignArray(fNarrowWeekdays, fNarrowWeekdaysCount, other.fNarrowWeekdays, other.fNarrowWeekdaysCount);
     assignArray(fStandaloneWeekdays, fStandaloneWeekdaysCount, other.fStandaloneWeekdays, other.fStandaloneWeekdaysCount);
     assignArray(fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount, other.fStandaloneShortWeekdays, other.fStandaloneShortWeekdaysCount);
+    assignArray(fStandaloneShorterWeekdays, fStandaloneShorterWeekdaysCount, other.fStandaloneShorterWeekdays, other.fStandaloneShorterWeekdaysCount);
     assignArray(fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, other.fStandaloneNarrowWeekdays, other.fStandaloneNarrowWeekdaysCount);
     assignArray(fAmPms, fAmPmsCount, other.fAmPms, other.fAmPmsCount);
+    assignArray(fNarrowAmPms, fNarrowAmPmsCount, other.fNarrowAmPms, other.fNarrowAmPmsCount );
+    fTimeSeparator.fastCopyFrom(other.fTimeSeparator);  // fastCopyFrom() - see assignArray comments
     assignArray(fQuarters, fQuartersCount, other.fQuarters, other.fQuartersCount);
     assignArray(fShortQuarters, fShortQuartersCount, other.fShortQuarters, other.fShortQuartersCount);
     assignArray(fStandaloneQuarters, fStandaloneQuartersCount, other.fStandaloneQuarters, other.fStandaloneQuartersCount);
     assignArray(fStandaloneShortQuarters, fStandaloneShortQuartersCount, other.fStandaloneShortQuarters, other.fStandaloneShortQuartersCount);
-    // the zoneStrings data is initialized on demand
-    //fZoneStringsRowCount = other.fZoneStringsRowCount;
-    //fZoneStringsColCount = other.fZoneStringsColCount;
-    //createZoneStrings((const UnicodeString**)other.fZoneStrings);
-    // initialize on demand
-    fZoneStringsHash = NULL;
-    fZoneIDEnumeration = NULL;
-    fZoneStrings = NULL;
-    fZoneStringsColCount = 0;
-    fZoneStringsRowCount = 0;
-    fResourceBundle = NULL;
-    if(other.fZoneStringsHash!=NULL){
-        fZoneStringsHash = createZoneStringsHash(other.fZoneStringsHash);
-        fZoneIDEnumeration = other.fZoneIDEnumeration->clone();
-    }else{
-        UErrorCode status =U_ZERO_ERROR;
-        fResourceBundle = ures_clone(other.fResourceBundle, &status);
-        // TODO: what should be done in case of error?
-    }
+    assignArray(fWideDayPeriods, fWideDayPeriodsCount,
+                other.fWideDayPeriods, other.fWideDayPeriodsCount);
+    assignArray(fNarrowDayPeriods, fNarrowDayPeriodsCount,
+                other.fNarrowDayPeriods, other.fNarrowDayPeriodsCount);
+    assignArray(fAbbreviatedDayPeriods, fAbbreviatedDayPeriodsCount,
+                other.fAbbreviatedDayPeriods, other.fAbbreviatedDayPeriodsCount);
+    assignArray(fStandaloneWideDayPeriods, fStandaloneWideDayPeriodsCount,
+                other.fStandaloneWideDayPeriods, other.fStandaloneWideDayPeriodsCount);
+    assignArray(fStandaloneNarrowDayPeriods, fStandaloneNarrowDayPeriodsCount,
+                other.fStandaloneNarrowDayPeriods, other.fStandaloneNarrowDayPeriodsCount);
+    assignArray(fStandaloneAbbreviatedDayPeriods, fStandaloneAbbreviatedDayPeriodsCount,
+                other.fStandaloneAbbreviatedDayPeriods, other.fStandaloneAbbreviatedDayPeriodsCount);
+    if (other.fLeapMonthPatterns != NULL) {
+        assignArray(fLeapMonthPatterns, fLeapMonthPatternsCount, other.fLeapMonthPatterns, other.fLeapMonthPatternsCount);
+    } else {
+        fLeapMonthPatterns = NULL;
+        fLeapMonthPatternsCount = 0;
+    }
+    if (other.fShortYearNames != NULL) {
+        assignArray(fShortYearNames, fShortYearNamesCount, other.fShortYearNames, other.fShortYearNamesCount);
+    } else {
+        fShortYearNames = NULL;
+        fShortYearNamesCount = 0;
+    }
+    if (other.fShortZodiacNames != NULL) {
+        assignArray(fShortZodiacNames, fShortZodiacNamesCount, other.fShortZodiacNames, other.fShortZodiacNamesCount);
+    } else {
+        fShortZodiacNames = NULL;
+        fShortZodiacNamesCount = 0;
+    }
+
+    if (other.fZoneStrings != NULL) {
+        fZoneStringsColCount = other.fZoneStringsColCount;
+        fZoneStringsRowCount = other.fZoneStringsRowCount;
+        createZoneStrings((const UnicodeString**)other.fZoneStrings);
+
+    } else {
+        fZoneStrings = NULL;
+        fZoneStringsColCount = 0;
+        fZoneStringsRowCount = 0;
+    }
+    fZSFLocale = other.fZSFLocale;
+    // Other zone strings data is created on demand
+    fLocaleZoneStrings = NULL;
 
     // fastCopyFrom() - see assignArray comments
     fLocalPatternChars.fastCopyFrom(other.fLocalPatternChars);
+
+    uprv_memcpy(fCapitalization, other.fCapitalization, sizeof(fCapitalization));
 }
 
 /**
@@ -356,25 +463,38 @@ DateFormatSymbols::~DateFormatSymbols()
 
 void DateFormatSymbols::dispose()
 {
-    if (fEras)                     delete[] fEras;
-    if (fEraNames)                 delete[] fEraNames;
-    if (fMonths)                   delete[] fMonths;
-    if (fShortMonths)              delete[] fShortMonths;
-    if (fNarrowMonths)             delete[] fNarrowMonths;
-    if (fStandaloneMonths)         delete[] fStandaloneMonths;
-    if (fStandaloneShortMonths)    delete[] fStandaloneShortMonths;
-    if (fStandaloneNarrowMonths)   delete[] fStandaloneNarrowMonths;
-    if (fWeekdays)                 delete[] fWeekdays;
-    if (fShortWeekdays)            delete[] fShortWeekdays;
-    if (fNarrowWeekdays)           delete[] fNarrowWeekdays;
-    if (fStandaloneWeekdays)       delete[] fStandaloneWeekdays;
-    if (fStandaloneShortWeekdays)  delete[] fStandaloneShortWeekdays;
-    if (fStandaloneNarrowWeekdays) delete[] fStandaloneNarrowWeekdays;
-    if (fAmPms)                    delete[] fAmPms;
-    if (fQuarters)                 delete[] fQuarters;
-    if (fShortQuarters)            delete[] fShortQuarters;
-    if (fStandaloneQuarters)       delete[] fStandaloneQuarters;
-    if (fStandaloneShortQuarters)  delete[] fStandaloneShortQuarters;
+    delete[] fEras;
+    delete[] fEraNames;
+    delete[] fNarrowEras;
+    delete[] fMonths;
+    delete[] fShortMonths;
+    delete[] fNarrowMonths;
+    delete[] fStandaloneMonths;
+    delete[] fStandaloneShortMonths;
+    delete[] fStandaloneNarrowMonths;
+    delete[] fWeekdays;
+    delete[] fShortWeekdays;
+    delete[] fShorterWeekdays;
+    delete[] fNarrowWeekdays;
+    delete[] fStandaloneWeekdays;
+    delete[] fStandaloneShortWeekdays;
+    delete[] fStandaloneShorterWeekdays;
+    delete[] fStandaloneNarrowWeekdays;
+    delete[] fAmPms;
+    delete[] fNarrowAmPms;
+    delete[] fQuarters;
+    delete[] fShortQuarters;
+    delete[] fStandaloneQuarters;
+    delete[] fStandaloneShortQuarters;
+    delete[] fLeapMonthPatterns;
+    delete[] fShortYearNames;
+    delete[] fShortZodiacNames;
+    delete[] fAbbreviatedDayPeriods;
+    delete[] fWideDayPeriods;
+    delete[] fNarrowDayPeriods;
+    delete[] fStandaloneAbbreviatedDayPeriods;
+    delete[] fStandaloneWideDayPeriods;
+    delete[] fStandaloneNarrowDayPeriods;
 
     disposeZoneStrings();
 }
@@ -382,20 +502,22 @@ void DateFormatSymbols::dispose()
 void DateFormatSymbols::disposeZoneStrings()
 {
     if (fZoneStrings) {
-        for (int32_t row=0; row<fZoneStringsRowCount; ++row)
+        for (int32_t row = 0; row < fZoneStringsRowCount; ++row) {
             delete[] fZoneStrings[row];
+        }
         uprv_free(fZoneStrings);
-    } 
-    if(fZoneStringsHash){
-        delete fZoneStringsHash;
-        fZoneStringsHash =  NULL;
     }
-    if(fZoneIDEnumeration){
-        delete fZoneIDEnumeration; 
-        fZoneIDEnumeration = NULL;
+    if (fLocaleZoneStrings) {
+        for (int32_t row = 0; row < fZoneStringsRowCount; ++row) {
+            delete[] fLocaleZoneStrings[row];
+        }
+        uprv_free(fLocaleZoneStrings);
     }
-    ures_close(fResourceBundle);
-    fResourceBundle = NULL;
+
+    fZoneStrings = NULL;
+    fLocaleZoneStrings = NULL;
+    fZoneStringsRowCount = 0;
+    fZoneStringsColCount = 0;
 }
 
 UBool
@@ -421,6 +543,7 @@ DateFormatSymbols::operator==(const DateFormatSymbols& other) const
     }
     if (fErasCount == other.fErasCount &&
         fEraNamesCount == other.fEraNamesCount &&
+        fNarrowErasCount == other.fNarrowErasCount &&
         fMonthsCount == other.fMonthsCount &&
         fShortMonthsCount == other.fShortMonthsCount &&
         fNarrowMonthsCount == other.fNarrowMonthsCount &&
@@ -429,19 +552,33 @@ DateFormatSymbols::operator==(const DateFormatSymbols& other) const
         fStandaloneNarrowMonthsCount == other.fStandaloneNarrowMonthsCount &&
         fWeekdaysCount == other.fWeekdaysCount &&
         fShortWeekdaysCount == other.fShortWeekdaysCount &&
+        fShorterWeekdaysCount == other.fShorterWeekdaysCount &&
         fNarrowWeekdaysCount == other.fNarrowWeekdaysCount &&
         fStandaloneWeekdaysCount == other.fStandaloneWeekdaysCount &&
         fStandaloneShortWeekdaysCount == other.fStandaloneShortWeekdaysCount &&
+        fStandaloneShorterWeekdaysCount == other.fStandaloneShorterWeekdaysCount &&
         fStandaloneNarrowWeekdaysCount == other.fStandaloneNarrowWeekdaysCount &&
         fAmPmsCount == other.fAmPmsCount &&
+        fNarrowAmPmsCount == other.fNarrowAmPmsCount &&
         fQuartersCount == other.fQuartersCount &&
         fShortQuartersCount == other.fShortQuartersCount &&
         fStandaloneQuartersCount == other.fStandaloneQuartersCount &&
-        fStandaloneShortQuartersCount == other.fStandaloneShortQuartersCount)
+        fStandaloneShortQuartersCount == other.fStandaloneShortQuartersCount &&
+        fLeapMonthPatternsCount == other.fLeapMonthPatternsCount &&
+        fShortYearNamesCount == other.fShortYearNamesCount &&
+        fShortZodiacNamesCount == other.fShortZodiacNamesCount &&
+        fAbbreviatedDayPeriodsCount == other.fAbbreviatedDayPeriodsCount &&
+        fWideDayPeriodsCount == other.fWideDayPeriodsCount &&
+        fNarrowDayPeriodsCount == other.fNarrowDayPeriodsCount &&
+        fStandaloneAbbreviatedDayPeriodsCount == other.fStandaloneAbbreviatedDayPeriodsCount &&
+        fStandaloneWideDayPeriodsCount == other.fStandaloneWideDayPeriodsCount &&
+        fStandaloneNarrowDayPeriodsCount == other.fStandaloneNarrowDayPeriodsCount &&
+        (uprv_memcmp(fCapitalization, other.fCapitalization, sizeof(fCapitalization))==0))
     {
         // Now compare the arrays themselves
         if (arrayCompare(fEras, other.fEras, fErasCount) &&
             arrayCompare(fEraNames, other.fEraNames, fEraNamesCount) &&
+            arrayCompare(fNarrowEras, other.fNarrowEras, fNarrowErasCount) &&
             arrayCompare(fMonths, other.fMonths, fMonthsCount) &&
             arrayCompare(fShortMonths, other.fShortMonths, fShortMonthsCount) &&
             arrayCompare(fNarrowMonths, other.fNarrowMonths, fNarrowMonthsCount) &&
@@ -450,33 +587,48 @@ DateFormatSymbols::operator==(const DateFormatSymbols& other) const
             arrayCompare(fStandaloneNarrowMonths, other.fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount) &&
             arrayCompare(fWeekdays, other.fWeekdays, fWeekdaysCount) &&
             arrayCompare(fShortWeekdays, other.fShortWeekdays, fShortWeekdaysCount) &&
+            arrayCompare(fShorterWeekdays, other.fShorterWeekdays, fShorterWeekdaysCount) &&
             arrayCompare(fNarrowWeekdays, other.fNarrowWeekdays, fNarrowWeekdaysCount) &&
             arrayCompare(fStandaloneWeekdays, other.fStandaloneWeekdays, fStandaloneWeekdaysCount) &&
             arrayCompare(fStandaloneShortWeekdays, other.fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount) &&
+            arrayCompare(fStandaloneShorterWeekdays, other.fStandaloneShorterWeekdays, fStandaloneShorterWeekdaysCount) &&
             arrayCompare(fStandaloneNarrowWeekdays, other.fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount) &&
             arrayCompare(fAmPms, other.fAmPms, fAmPmsCount) &&
+            arrayCompare(fNarrowAmPms, other.fNarrowAmPms, fNarrowAmPmsCount) &&
+            fTimeSeparator == other.fTimeSeparator &&
             arrayCompare(fQuarters, other.fQuarters, fQuartersCount) &&
             arrayCompare(fShortQuarters, other.fShortQuarters, fShortQuartersCount) &&
             arrayCompare(fStandaloneQuarters, other.fStandaloneQuarters, fStandaloneQuartersCount) &&
-            arrayCompare(fStandaloneShortQuarters, other.fStandaloneShortQuarters, fStandaloneShortQuartersCount))
+            arrayCompare(fStandaloneShortQuarters, other.fStandaloneShortQuarters, fStandaloneShortQuartersCount) &&
+            arrayCompare(fLeapMonthPatterns, other.fLeapMonthPatterns, fLeapMonthPatternsCount) &&
+            arrayCompare(fShortYearNames, other.fShortYearNames, fShortYearNamesCount) &&
+            arrayCompare(fShortZodiacNames, other.fShortZodiacNames, fShortZodiacNamesCount) &&
+            arrayCompare(fAbbreviatedDayPeriods, other.fAbbreviatedDayPeriods, fAbbreviatedDayPeriodsCount) &&
+            arrayCompare(fWideDayPeriods, other.fWideDayPeriods, fWideDayPeriodsCount) &&
+            arrayCompare(fNarrowDayPeriods, other.fNarrowDayPeriods, fNarrowDayPeriodsCount) &&
+            arrayCompare(fStandaloneAbbreviatedDayPeriods, other.fStandaloneAbbreviatedDayPeriods,
+                         fStandaloneAbbreviatedDayPeriodsCount) &&
+            arrayCompare(fStandaloneWideDayPeriods, other.fStandaloneWideDayPeriods,
+                         fStandaloneWideDayPeriodsCount) &&
+            arrayCompare(fStandaloneNarrowDayPeriods, other.fStandaloneNarrowDayPeriods,
+                         fStandaloneWideDayPeriodsCount))
         {
-            
-            if(fZoneStringsHash == NULL || other.fZoneStringsHash == NULL){
-                // fZoneStringsHash is not initialized compare the resource bundles
-                if(ures_equal(fResourceBundle, other.fResourceBundle)== FALSE){
-                    return FALSE;
+            // Compare the contents of fZoneStrings
+            if (fZoneStrings == NULL && other.fZoneStrings == NULL) {
+                if (fZSFLocale == other.fZSFLocale) {
+                    return TRUE;
                 }
-            }else{
-                if(fZoneStringsHash->equals(*other.fZoneStringsHash) == FALSE){
-                    return FALSE;
+            } else if (fZoneStrings != NULL && other.fZoneStrings != NULL) {
+                if (fZoneStringsRowCount == other.fZoneStringsRowCount
+                    && fZoneStringsColCount == other.fZoneStringsColCount) {
+                    UBool cmpres = TRUE;
+                    for (int32_t i = 0; (i < fZoneStringsRowCount) && cmpres; i++) {
+                        cmpres = arrayCompare(fZoneStrings[i], other.fZoneStrings[i], fZoneStringsColCount);
+                    }
+                    return cmpres;
                 }
-                // we always make sure that we update the enumeration when the hash is
-                // updated. So we can be sure that once we compare the hashes  the 
-                // enumerations are also equal
             }
-            // since fZoneStrings data member is deprecated .. and may not be initialized
-            // so don't compare them
-            return TRUE;
+            return FALSE;
         }
     }
     return FALSE;
@@ -498,6 +650,13 @@ DateFormatSymbols::getEraNames(int32_t &count) const
     return fEraNames;
 }
 
+const UnicodeString*
+DateFormatSymbols::getNarrowEras(int32_t &count) const
+{
+    count = fNarrowErasCount;
+    return fNarrowEras;
+}
+
 const UnicodeString*
 DateFormatSymbols::getMonths(int32_t &count) const
 {
@@ -525,6 +684,7 @@ DateFormatSymbols::getMonths(int32_t &count, DtContextType context, DtWidthType
             returnValue = fMonths;
             break;
         case ABBREVIATED :
+        case SHORT : // no month data for this, defaults to ABBREVIATED
             count = fShortMonthsCount;
             returnValue = fShortMonths;
             break;
@@ -543,6 +703,7 @@ DateFormatSymbols::getMonths(int32_t &count, DtContextType context, DtWidthType
             returnValue = fStandaloneMonths;
             break;
         case ABBREVIATED :
+        case SHORT : // no month data for this, defaults to ABBREVIATED
             count = fStandaloneShortMonthsCount;
             returnValue = fStandaloneShortMonths;
             break;
@@ -589,6 +750,10 @@ DateFormatSymbols::getWeekdays(int32_t &count, DtContextType context, DtWidthTyp
                 count = fShortWeekdaysCount;
                 returnValue = fShortWeekdays;
                 break;
+            case SHORT :
+                count = fShorterWeekdaysCount;
+                returnValue = fShorterWeekdays;
+                break;
             case NARROW :
                 count = fNarrowWeekdaysCount;
                 returnValue = fNarrowWeekdays;
@@ -607,6 +772,10 @@ DateFormatSymbols::getWeekdays(int32_t &count, DtContextType context, DtWidthTyp
                 count = fStandaloneShortWeekdaysCount;
                 returnValue = fStandaloneShortWeekdays;
                 break;
+            case SHORT :
+                count = fStandaloneShorterWeekdaysCount;
+                returnValue = fStandaloneShorterWeekdays;
+                break;
             case NARROW :
                 count = fStandaloneNarrowWeekdaysCount;
                 returnValue = fStandaloneNarrowWeekdays;
@@ -634,6 +803,7 @@ DateFormatSymbols::getQuarters(int32_t &count, DtContextType context, DtWidthTyp
             returnValue = fQuarters;
             break;
         case ABBREVIATED :
+        case SHORT : // no quarter data for this, defaults to ABBREVIATED
             count = fShortQuartersCount;
             returnValue = fShortQuarters;
             break;
@@ -652,6 +822,7 @@ DateFormatSymbols::getQuarters(int32_t &count, DtContextType context, DtWidthTyp
             returnValue = fStandaloneQuarters;
             break;
         case ABBREVIATED :
+        case SHORT : // no quarter data for this, defaults to ABBREVIATED
             count = fStandaloneShortQuartersCount;
             returnValue = fStandaloneShortQuarters;
             break;
@@ -669,6 +840,13 @@ DateFormatSymbols::getQuarters(int32_t &count, DtContextType context, DtWidthTyp
     return returnValue;
 }
 
+UnicodeString&
+DateFormatSymbols::getTimeSeparatorString(UnicodeString& result) const
+{
+    // fastCopyFrom() - see assignArray comments
+    return result.fastCopyFrom(fTimeSeparator);
+}
+
 const UnicodeString*
 DateFormatSymbols::getAmPmStrings(int32_t &count) const
 {
@@ -676,6 +854,57 @@ DateFormatSymbols::getAmPmStrings(int32_t &count) const
     return fAmPms;
 }
 
+const UnicodeString*
+DateFormatSymbols::getLeapMonthPatterns(int32_t &count) const
+{
+    count = fLeapMonthPatternsCount;
+    return fLeapMonthPatterns;
+}
+
+const UnicodeString*
+DateFormatSymbols::getYearNames(int32_t& count,
+                                DtContextType /*ignored*/, DtWidthType /*ignored*/) const
+{
+    count = fShortYearNamesCount;
+    return fShortYearNames;
+}
+
+void
+DateFormatSymbols::setYearNames(const UnicodeString* yearNames, int32_t count,
+                                DtContextType context, DtWidthType width)
+{
+    if (context == FORMAT && width == ABBREVIATED) {
+        if (fShortYearNames) {
+            delete[] fShortYearNames;
+        }
+        fShortYearNames = newUnicodeStringArray(count);
+        uprv_arrayCopy(yearNames, fShortYearNames, count);
+        fShortYearNamesCount = count;
+    }
+}
+
+const UnicodeString*
+DateFormatSymbols::getZodiacNames(int32_t& count,
+                                DtContextType /*ignored*/, DtWidthType /*ignored*/) const
+{
+    count = fShortZodiacNamesCount;
+    return fShortZodiacNames;
+}
+
+void
+DateFormatSymbols::setZodiacNames(const UnicodeString* zodiacNames, int32_t count,
+                                DtContextType context, DtWidthType width)
+{
+    if (context == FORMAT && width == ABBREVIATED) {
+        if (fShortZodiacNames) {
+            delete[] fShortZodiacNames;
+        }
+        fShortZodiacNames = newUnicodeStringArray(count);
+        uprv_arrayCopy(zodiacNames, fShortZodiacNames, count);
+        fShortZodiacNamesCount = count;
+    }
+}
+
 //------------------------------------------------------
 
 void
@@ -706,6 +935,20 @@ DateFormatSymbols::setEraNames(const UnicodeString* eraNamesArray, int32_t count
     fEraNamesCount = count;
 }
 
+void
+DateFormatSymbols::setNarrowEras(const UnicodeString* narrowErasArray, int32_t count)
+{
+    // delete the old list if we own it
+    if (fNarrowEras)
+        delete[] fNarrowEras;
+
+    // we always own the new list, which we create here (we duplicate rather
+    // than adopting the list passed in)
+    fNarrowEras = newUnicodeStringArray(count);
+    uprv_arrayCopy(narrowErasArray,fNarrowEras,  count);
+    fNarrowErasCount = count;
+}
+
 void
 DateFormatSymbols::setMonths(const UnicodeString* monthsArray, int32_t count)
 {
@@ -764,8 +1007,8 @@ DateFormatSymbols::setMonths(const UnicodeString* monthsArray, int32_t count, Dt
             fNarrowMonths = newUnicodeStringArray(count);
             uprv_arrayCopy( monthsArray,fNarrowMonths,count);
             fNarrowMonthsCount = count;
-            break; 
-        case DT_WIDTH_COUNT :
+            break;
+        default :
             break;
         }
         break;
@@ -791,8 +1034,8 @@ DateFormatSymbols::setMonths(const UnicodeString* monthsArray, int32_t count, Dt
             fStandaloneNarrowMonths = newUnicodeStringArray(count);
             uprv_arrayCopy( monthsArray,fStandaloneNarrowMonths,count);
             fStandaloneNarrowMonthsCount = count;
-            break; 
-        case DT_WIDTH_COUNT :
+            break;
+        default :
             break;
         }
         break;
@@ -852,13 +1095,20 @@ DateFormatSymbols::setWeekdays(const UnicodeString* weekdaysArray, int32_t count
             uprv_arrayCopy(weekdaysArray, fShortWeekdays, count);
             fShortWeekdaysCount = count;
             break;
+        case SHORT :
+            if (fShorterWeekdays)
+                delete[] fShorterWeekdays;
+            fShorterWeekdays = newUnicodeStringArray(count);
+            uprv_arrayCopy(weekdaysArray, fShorterWeekdays, count);
+            fShorterWeekdaysCount = count;
+            break;
         case NARROW :
             if (fNarrowWeekdays)
                 delete[] fNarrowWeekdays;
             fNarrowWeekdays = newUnicodeStringArray(count);
             uprv_arrayCopy(weekdaysArray, fNarrowWeekdays, count);
             fNarrowWeekdaysCount = count;
-            break; 
+            break;
         case DT_WIDTH_COUNT :
             break;
         }
@@ -879,13 +1129,20 @@ DateFormatSymbols::setWeekdays(const UnicodeString* weekdaysArray, int32_t count
             uprv_arrayCopy(weekdaysArray, fStandaloneShortWeekdays, count);
             fStandaloneShortWeekdaysCount = count;
             break;
+        case SHORT :
+            if (fStandaloneShorterWeekdays)
+                delete[] fStandaloneShorterWeekdays;
+            fStandaloneShorterWeekdays = newUnicodeStringArray(count);
+            uprv_arrayCopy(weekdaysArray, fStandaloneShorterWeekdays, count);
+            fStandaloneShorterWeekdaysCount = count;
+            break;
         case NARROW :
             if (fStandaloneNarrowWeekdays)
                 delete[] fStandaloneNarrowWeekdays;
             fStandaloneNarrowWeekdays = newUnicodeStringArray(count);
             uprv_arrayCopy(weekdaysArray, fStandaloneNarrowWeekdays, count);
             fStandaloneNarrowWeekdaysCount = count;
-            break; 
+            break;
         case DT_WIDTH_COUNT :
             break;
         }
@@ -927,8 +1184,8 @@ DateFormatSymbols::setQuarters(const UnicodeString* quartersArray, int32_t count
             uprv_arrayCopy( quartersArray,fNarrowQuarters,count);
             fNarrowQuartersCount = count;
         */
-            break; 
-        case DT_WIDTH_COUNT :
+            break;
+        default :
             break;
         }
         break;
@@ -956,8 +1213,8 @@ DateFormatSymbols::setQuarters(const UnicodeString* quartersArray, int32_t count
             uprv_arrayCopy( quartersArray,fStandaloneNarrowQuarters,count);
             fStandaloneNarrowQuartersCount = count;
         */
-            break; 
-        case DT_WIDTH_COUNT :
+            break;
+        default :
             break;
         }
         break;
@@ -979,24 +1236,123 @@ DateFormatSymbols::setAmPmStrings(const UnicodeString* amPmsArray, int32_t count
     fAmPmsCount = count;
 }
 
-//------------------------------------------------------
+void
+DateFormatSymbols::setTimeSeparatorString(const UnicodeString& newTimeSeparator)
+{
+    fTimeSeparator = newTimeSeparator;
+}
 
 const UnicodeString**
 DateFormatSymbols::getZoneStrings(int32_t& rowCount, int32_t& columnCount) const
 {
-    umtx_lock(&LOCK);
-    UErrorCode status = U_ZERO_ERROR;
-    if(fZoneStrings==NULL){
-        // cast away const to get around the problem for lazy initialization
-        ((DateFormatSymbols*)this)->initZoneStringsArray(status);
-        if(U_FAILURE(status)){
-            return NULL;
+    const UnicodeString **result = NULL;
+    static UMutex *LOCK = STATIC_NEW(UMutex);
+
+    umtx_lock(LOCK);
+    if (fZoneStrings == NULL) {
+        if (fLocaleZoneStrings == NULL) {
+            ((DateFormatSymbols*)this)->initZoneStringsArray();
         }
+        result = (const UnicodeString**)fLocaleZoneStrings;
+    } else {
+        result = (const UnicodeString**)fZoneStrings;
     }
     rowCount = fZoneStringsRowCount;
     columnCount = fZoneStringsColCount;
-    umtx_unlock(&LOCK);
-    return (const UnicodeString**)fZoneStrings; // Compiler requires cast
+    umtx_unlock(LOCK);
+
+    return result;
+}
+
+// For now, we include all zones
+#define ZONE_SET UCAL_ZONE_TYPE_ANY
+
+// This code must be called within a synchronized block
+void
+DateFormatSymbols::initZoneStringsArray(void) {
+    if (fZoneStrings != NULL || fLocaleZoneStrings != NULL) {
+        return;
+    }
+
+    UErrorCode status = U_ZERO_ERROR;
+
+    StringEnumeration *tzids = NULL;
+    UnicodeString ** zarray = NULL;
+    TimeZoneNames *tzNames = NULL;
+    int32_t rows = 0;
+
+    static const UTimeZoneNameType TYPES[] = {
+        UTZNM_LONG_STANDARD, UTZNM_SHORT_STANDARD,
+        UTZNM_LONG_DAYLIGHT, UTZNM_SHORT_DAYLIGHT
+    };
+    static const int32_t NUM_TYPES = 4;
+
+    do { // dummy do-while
+
+        tzids = TimeZone::createTimeZoneIDEnumeration(ZONE_SET, NULL, NULL, status);
+        rows = tzids->count(status);
+        if (U_FAILURE(status)) {
+            break;
+        }
+
+        // Allocate array
+        int32_t size = rows * sizeof(UnicodeString*);
+        zarray = (UnicodeString**)uprv_malloc(size);
+        if (zarray == NULL) {
+            status = U_MEMORY_ALLOCATION_ERROR;
+            break;
+        }
+        uprv_memset(zarray, 0, size);
+
+        tzNames = TimeZoneNames::createInstance(fZSFLocale, status);
+        tzNames->loadAllDisplayNames(status);
+        if (U_FAILURE(status)) { break; }
+
+        const UnicodeString *tzid;
+        int32_t i = 0;
+        UDate now = Calendar::getNow();
+        UnicodeString tzDispName;
+
+        while ((tzid = tzids->snext(status)) != 0) {
+            if (U_FAILURE(status)) {
+                break;
+            }
+
+            zarray[i] = new UnicodeString[5];
+            if (zarray[i] == NULL) {
+                status = U_MEMORY_ALLOCATION_ERROR;
+                break;
+            }
+
+            zarray[i][0].setTo(*tzid);
+            tzNames->getDisplayNames(*tzid, TYPES, NUM_TYPES, now, zarray[i]+1, status);
+            i++;
+        }
+
+    } while (FALSE);
+
+    if (U_FAILURE(status)) {
+        if (zarray) {
+            for (int32_t i = 0; i < rows; i++) {
+                if (zarray[i]) {
+                    delete[] zarray[i];
+                }
+            }
+            uprv_free(zarray);
+            zarray = NULL;
+        }
+    }
+
+    if (tzNames) {
+        delete tzNames;
+    }
+    if (tzids) {
+        delete tzids;
+    }
+
+    fLocaleZoneStrings = zarray;
+    fZoneStringsRowCount = rows;
+    fZoneStringsColCount = 1 + NUM_TYPES;
 }
 
 void
@@ -1005,23 +1361,73 @@ DateFormatSymbols::setZoneStrings(const UnicodeString* const *strings, int32_t r
     // since deleting a 2-d array is a pain in the butt, we offload that task to
     // a separate function
     disposeZoneStrings();
-    UErrorCode status = U_ZERO_ERROR;
     // we always own the new list, which we create here (we duplicate rather
     // than adopting the list passed in)
     fZoneStringsRowCount = rowCount;
     fZoneStringsColCount = columnCount;
     createZoneStrings((const UnicodeString**)strings);
-    initZoneStrings((const UnicodeString**)strings, rowCount,columnCount, status);
 }
 
 //------------------------------------------------------
 
-const UChar * U_EXPORT2
+const char16_t * U_EXPORT2
 DateFormatSymbols::getPatternUChars(void)
 {
     return gPatternChars;
 }
 
+UDateFormatField U_EXPORT2
+DateFormatSymbols::getPatternCharIndex(UChar c) {
+    const UChar *p = u_strchr(gPatternChars, c);
+    if (p == NULL) {
+        return UDAT_FIELD_COUNT;
+    } else {
+        return static_cast<UDateFormatField>(p - gPatternChars);
+    }
+}
+
+static const uint64_t kNumericFieldsAlways =
+    ((uint64_t)1 << UDAT_YEAR_FIELD) |                      // y
+    ((uint64_t)1 << UDAT_DATE_FIELD) |                      // d
+    ((uint64_t)1 << UDAT_HOUR_OF_DAY1_FIELD) |              // k
+    ((uint64_t)1 << UDAT_HOUR_OF_DAY0_FIELD) |              // H
+    ((uint64_t)1 << UDAT_MINUTE_FIELD) |                    // m
+    ((uint64_t)1 << UDAT_SECOND_FIELD) |                    // s
+    ((uint64_t)1 << UDAT_FRACTIONAL_SECOND_FIELD) |         // S
+    ((uint64_t)1 << UDAT_DAY_OF_YEAR_FIELD) |               // D
+    ((uint64_t)1 << UDAT_DAY_OF_WEEK_IN_MONTH_FIELD) |      // F
+    ((uint64_t)1 << UDAT_WEEK_OF_YEAR_FIELD) |              // w
+    ((uint64_t)1 << UDAT_WEEK_OF_MONTH_FIELD) |             // W
+    ((uint64_t)1 << UDAT_HOUR1_FIELD) |                     // h
+    ((uint64_t)1 << UDAT_HOUR0_FIELD) |                     // K
+    ((uint64_t)1 << UDAT_YEAR_WOY_FIELD) |                  // Y
+    ((uint64_t)1 << UDAT_EXTENDED_YEAR_FIELD) |             // u
+    ((uint64_t)1 << UDAT_JULIAN_DAY_FIELD) |                // g
+    ((uint64_t)1 << UDAT_MILLISECONDS_IN_DAY_FIELD) |       // A
+    ((uint64_t)1 << UDAT_RELATED_YEAR_FIELD);               // r
+
+static const uint64_t kNumericFieldsForCount12 =
+    ((uint64_t)1 << UDAT_MONTH_FIELD) |                     // M or MM
+    ((uint64_t)1 << UDAT_DOW_LOCAL_FIELD) |                 // e or ee
+    ((uint64_t)1 << UDAT_STANDALONE_DAY_FIELD) |            // c or cc
+    ((uint64_t)1 << UDAT_STANDALONE_MONTH_FIELD) |          // L or LL
+    ((uint64_t)1 << UDAT_QUARTER_FIELD) |                   // Q or QQ
+    ((uint64_t)1 << UDAT_STANDALONE_QUARTER_FIELD);         // q or qq
+
+UBool U_EXPORT2
+DateFormatSymbols::isNumericField(UDateFormatField f, int32_t count) {
+    if (f == UDAT_FIELD_COUNT) {
+        return FALSE;
+    }
+    uint64_t flag = ((uint64_t)1 << f);
+    return ((kNumericFieldsAlways & flag) != 0 || ((kNumericFieldsForCount12 & flag) != 0 && count < 3));
+}
+
+UBool U_EXPORT2
+DateFormatSymbols::isNumericPatternChar(UChar c, int32_t count) {
+    return isNumericField(getPatternCharIndex(c), count);
+}
+
 //------------------------------------------------------
 
 UnicodeString&
@@ -1041,25 +1447,408 @@ DateFormatSymbols::setLocalPatternChars(const UnicodeString& newLocalPatternChar
 
 //------------------------------------------------------
 
-static void
-initField(UnicodeString **field, int32_t& length, const UResourceBundle *data, UErrorCode &status) {
-    if (U_SUCCESS(status)) {
-        int32_t strLen = 0;
-        length = ures_getSize(data);
-        *field = newUnicodeStringArray(length);
-        if (*field) {
-            for(int32_t i = 0; i<length; i++) {
-                const UChar *resStr = ures_getStringByIndex(data, i, &strLen, &status);
-                // setTo() - see assignArray comments
-                (*(field)+i)->setTo(TRUE, resStr, strLen);
+namespace {
+
+// Constants declarations
+static const UChar kCalendarAliasPrefixUChar[] = {
+    SOLIDUS, CAP_L, CAP_O, CAP_C, CAP_A, CAP_L, CAP_E, SOLIDUS,
+    LOW_C, LOW_A, LOW_L, LOW_E, LOW_N, LOW_D, LOW_A, LOW_R, SOLIDUS
+};
+static const UChar kGregorianTagUChar[] = {
+    LOW_G, LOW_R, LOW_E, LOW_G, LOW_O, LOW_R, LOW_I, LOW_A, LOW_N
+};
+static const UChar kVariantTagUChar[] = {
+    PERCENT, LOW_V, LOW_A, LOW_R, LOW_I, LOW_A, LOW_N, LOW_T
+};
+static const UChar kLeapTagUChar[] = {
+    LOW_L, LOW_E, LOW_A, LOW_P
+};
+static const UChar kCyclicNameSetsTagUChar[] = {
+    LOW_C, LOW_Y, LOW_C, LOW_L, LOW_I, LOW_C, CAP_N, LOW_A, LOW_M, LOW_E, CAP_S, LOW_E, LOW_T, LOW_S
+};
+static const UChar kYearsTagUChar[] = {
+    SOLIDUS, LOW_Y, LOW_E, LOW_A, LOW_R, LOW_S
+};
+static const UChar kZodiacsUChar[] = {
+    SOLIDUS, LOW_Z, LOW_O, LOW_D, LOW_I, LOW_A, LOW_C, LOW_S
+};
+static const UChar kDayPartsTagUChar[] = {
+    SOLIDUS, LOW_D, LOW_A, LOW_Y, CAP_P, LOW_A, LOW_R, LOW_T, LOW_S
+};
+static const UChar kFormatTagUChar[] = {
+    SOLIDUS, LOW_F, LOW_O, LOW_R, LOW_M, LOW_A, LOW_T
+};
+static const UChar kAbbrTagUChar[] = {
+    SOLIDUS, LOW_A, LOW_B, LOW_B, LOW_R, LOW_E, LOW_V, LOW_I, LOW_A, LOW_T, LOW_E, LOW_D
+};
+
+// ResourceSink to enumerate all calendar resources
+struct CalendarDataSink : public ResourceSink {
+
+    // Enum which specifies the type of alias received, or no alias
+    enum AliasType {
+        SAME_CALENDAR,
+        DIFFERENT_CALENDAR,
+        GREGORIAN,
+        NONE
+    };
+
+    // Data structures to store resources from the current resource bundle
+    Hashtable arrays;
+    Hashtable arraySizes;
+    Hashtable maps;
+    /** 
+     * Whenever there are aliases, the same object will be added twice to 'map'.
+     * To avoid double deletion, 'maps' won't take ownership of the objects. Instead,
+     * 'mapRefs' will own them and will delete them when CalendarDataSink is deleted.
+     */
+    MemoryPool<Hashtable> mapRefs;
+
+    // Paths and the aliases they point to
+    UVector aliasPathPairs;
+
+    // Current and next calendar resource table which should be loaded
+    UnicodeString currentCalendarType;
+    UnicodeString nextCalendarType;
+
+    // Resources to visit when enumerating fallback calendars
+    LocalPointer<UVector> resourcesToVisit;
+
+    // Alias' relative path populated whenever an alias is read
+    UnicodeString aliasRelativePath;
+
+    // Initializes CalendarDataSink with default values
+    CalendarDataSink(UErrorCode& status)
+    :   arrays(FALSE, status), arraySizes(FALSE, status), maps(FALSE, status),
+        mapRefs(),
+        aliasPathPairs(uprv_deleteUObject, uhash_compareUnicodeString, status),
+        currentCalendarType(), nextCalendarType(),
+        resourcesToVisit(NULL), aliasRelativePath() {
+        if (U_FAILURE(status)) { return; }
+    }
+    virtual ~CalendarDataSink();
+
+    // Configure the CalendarSink to visit all the resources
+    void visitAllResources() {
+        resourcesToVisit.adoptInstead(NULL);
+    }
+
+    // Actions to be done before enumerating
+    void preEnumerate(const UnicodeString &calendarType) {
+        currentCalendarType = calendarType;
+        nextCalendarType.setToBogus();
+        aliasPathPairs.removeAllElements();
+    }
+
+    virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) {
+        if (U_FAILURE(errorCode)) { return; }
+        U_ASSERT(!currentCalendarType.isEmpty());
+
+        // Stores the resources to visit on the next calendar.
+        LocalPointer<UVector> resourcesToVisitNext(NULL);
+        ResourceTable calendarData = value.getTable(errorCode);
+        if (U_FAILURE(errorCode)) { return; }
+
+        // Enumerate all resources for this calendar
+        for (int i = 0; calendarData.getKeyAndValue(i, key, value); i++) {
+            UnicodeString keyUString(key, -1, US_INV);
+
+            // == Handle aliases ==
+            AliasType aliasType = processAliasFromValue(keyUString, value, errorCode);
+            if (U_FAILURE(errorCode)) { return; }
+            if (aliasType == GREGORIAN) {
+                // Ignore aliases to the gregorian calendar, all of its resources will be loaded anyway.
+                continue;
+
+            } else if (aliasType == DIFFERENT_CALENDAR) {
+                // Whenever an alias to the next calendar (except gregorian) is encountered, register the
+                // calendar type it's pointing to
+                if (resourcesToVisitNext.isNull()) {
+                    resourcesToVisitNext
+                        .adoptInsteadAndCheckErrorCode(new UVector(uprv_deleteUObject, uhash_compareUnicodeString, errorCode),
+                                                       errorCode);
+                    if (U_FAILURE(errorCode)) { return; }
+                }
+                LocalPointer<UnicodeString> aliasRelativePathCopy(new UnicodeString(aliasRelativePath), errorCode);
+                resourcesToVisitNext->addElement(aliasRelativePathCopy.getAlias(), errorCode);
+                if (U_FAILURE(errorCode)) { return; }
+                // Only release ownership after resourcesToVisitNext takes it (no error happened):
+                aliasRelativePathCopy.orphan();
+                continue;
+
+            } else if (aliasType == SAME_CALENDAR) {
+                // Register same-calendar alias
+                if (arrays.get(aliasRelativePath) == NULL && maps.get(aliasRelativePath) == NULL) {
+                    LocalPointer<UnicodeString> aliasRelativePathCopy(new UnicodeString(aliasRelativePath), errorCode);
+                    aliasPathPairs.addElement(aliasRelativePathCopy.getAlias(), errorCode);
+                    if (U_FAILURE(errorCode)) { return; }
+                    // Only release ownership after aliasPathPairs takes it (no error happened):
+                    aliasRelativePathCopy.orphan();
+                    LocalPointer<UnicodeString> keyUStringCopy(new UnicodeString(keyUString), errorCode);
+                    aliasPathPairs.addElement(keyUStringCopy.getAlias(), errorCode);
+                    if (U_FAILURE(errorCode)) { return; }
+                    // Only release ownership after aliasPathPairs takes it (no error happened):
+                    keyUStringCopy.orphan();
+                }
+                continue;
+            }
+
+            // Only visit the resources that were referenced by an alias on the previous calendar
+            // (AmPmMarkersAbbr is an exception).
+            if (!resourcesToVisit.isNull() && !resourcesToVisit->isEmpty() && !resourcesToVisit->contains(&keyUString)
+                && uprv_strcmp(key, gAmPmMarkersAbbrTag) != 0) { continue; }
+
+            // == Handle data ==
+            if (uprv_strcmp(key, gAmPmMarkersTag) == 0
+                || uprv_strcmp(key, gAmPmMarkersAbbrTag) == 0
+                || uprv_strcmp(key, gAmPmMarkersNarrowTag) == 0) {
+                if (arrays.get(keyUString) == NULL) {
+                    ResourceArray resourceArray = value.getArray(errorCode);
+                    int32_t arraySize = resourceArray.getSize();
+                    LocalArray<UnicodeString> stringArray(new UnicodeString[arraySize], errorCode);
+                    value.getStringArray(stringArray.getAlias(), arraySize, errorCode);
+                    arrays.put(keyUString, stringArray.orphan(), errorCode);
+                    arraySizes.puti(keyUString, arraySize, errorCode);
+                    if (U_FAILURE(errorCode)) { return; }
+                }
+            } else if (uprv_strcmp(key, gErasTag) == 0
+                       || uprv_strcmp(key, gDayNamesTag) == 0
+                       || uprv_strcmp(key, gMonthNamesTag) == 0
+                       || uprv_strcmp(key, gQuartersTag) == 0
+                       || uprv_strcmp(key, gDayPeriodTag) == 0
+                       || uprv_strcmp(key, gMonthPatternsTag) == 0
+                       || uprv_strcmp(key, gCyclicNameSetsTag) == 0) {
+                processResource(keyUString, key, value, errorCode);
             }
         }
-        else {
-            length = 0;
-            status = U_MEMORY_ALLOCATION_ERROR;
+
+        // Apply same-calendar aliases
+        UBool modified;
+        do {
+            modified = false;
+            for (int32_t i = 0; i < aliasPathPairs.size();) {
+                UBool mod = false;
+                UnicodeString *alias = (UnicodeString*)aliasPathPairs[i];
+                UnicodeString *aliasArray;
+                Hashtable *aliasMap;
+                if ((aliasArray = (UnicodeString*)arrays.get(*alias)) != NULL) {
+                    UnicodeString *path = (UnicodeString*)aliasPathPairs[i + 1];
+                    if (arrays.get(*path) == NULL) {
+                        // Clone the array
+                        int32_t aliasArraySize = arraySizes.geti(*alias);
+                        LocalArray<UnicodeString> aliasArrayCopy(new UnicodeString[aliasArraySize], errorCode);
+                        if (U_FAILURE(errorCode)) { return; }
+                        uprv_arrayCopy(aliasArray, aliasArrayCopy.getAlias(), aliasArraySize);
+                        // Put the array on the 'arrays' map
+                        arrays.put(*path, aliasArrayCopy.orphan(), errorCode);
+                        arraySizes.puti(*path, aliasArraySize, errorCode);
+                    }
+                    if (U_FAILURE(errorCode)) { return; }
+                    mod = true;
+                } else if ((aliasMap = (Hashtable*)maps.get(*alias)) != NULL) {
+                    UnicodeString *path = (UnicodeString*)aliasPathPairs[i + 1];
+                    if (maps.get(*path) == NULL) {
+                        maps.put(*path, aliasMap, errorCode);
+                    }
+                    if (U_FAILURE(errorCode)) { return; }
+                    mod = true;
+                }
+                if (mod) {
+                    aliasPathPairs.removeElementAt(i + 1);
+                    aliasPathPairs.removeElementAt(i);
+                    modified = true;
+                } else {
+                    i += 2;
+                }
+            }
+        } while (modified && !aliasPathPairs.isEmpty());
+
+        // Set the resources to visit on the next calendar
+        if (!resourcesToVisitNext.isNull()) {
+            resourcesToVisit = std::move(resourcesToVisitNext);
+        }
+    }
+
+    // Process the nested resource bundle tables
+    void processResource(UnicodeString &path, const char *key, ResourceValue &value, UErrorCode &errorCode) {
+        if (U_FAILURE(errorCode)) return;
+
+        ResourceTable table = value.getTable(errorCode);
+        if (U_FAILURE(errorCode)) return;
+        Hashtable* stringMap = NULL;
+
+        // Iterate over all the elements of the table and add them to the map
+        for (int i = 0; table.getKeyAndValue(i, key, value); i++) {
+            UnicodeString keyUString(key, -1, US_INV);
+
+            // Ignore '%variant' keys
+            if (keyUString.endsWith(kVariantTagUChar, UPRV_LENGTHOF(kVariantTagUChar))) {
+                continue;
+            }
+
+            // == Handle String elements ==
+            if (value.getType() == URES_STRING) {
+                // We are on a leaf, store the map elements into the stringMap
+                if (i == 0) {
+                    // mapRefs will keep ownership of 'stringMap':
+                    stringMap = mapRefs.create(FALSE, errorCode);
+                    if (stringMap == NULL) {
+                        errorCode = U_MEMORY_ALLOCATION_ERROR;
+                        return;
+                    }
+                    maps.put(path, stringMap, errorCode);
+                    if (U_FAILURE(errorCode)) { return; }
+                    stringMap->setValueDeleter(uprv_deleteUObject);
+                }
+                U_ASSERT(stringMap != NULL);
+                int32_t valueStringSize;
+                const UChar *valueString = value.getString(valueStringSize, errorCode);
+                if (U_FAILURE(errorCode)) { return; }
+                LocalPointer<UnicodeString> valueUString(new UnicodeString(TRUE, valueString, valueStringSize), errorCode);
+                stringMap->put(keyUString, valueUString.orphan(), errorCode);
+                if (U_FAILURE(errorCode)) { return; }
+                continue;
+            }
+            U_ASSERT(stringMap == NULL);
+
+            // Store the current path's length and append the current key to the path.
+            int32_t pathLength = path.length();
+            path.append(SOLIDUS).append(keyUString);
+
+            // In cyclicNameSets ignore everything but years/format/abbreviated
+            // and zodiacs/format/abbreviated
+            if (path.startsWith(kCyclicNameSetsTagUChar, UPRV_LENGTHOF(kCyclicNameSetsTagUChar))) {
+                UBool skip = TRUE;
+                int32_t startIndex = UPRV_LENGTHOF(kCyclicNameSetsTagUChar);
+                int32_t length = 0;
+                if (startIndex == path.length()
+                    || path.compare(startIndex, (length = UPRV_LENGTHOF(kZodiacsUChar)), kZodiacsUChar, 0, UPRV_LENGTHOF(kZodiacsUChar)) == 0
+                    || path.compare(startIndex, (length = UPRV_LENGTHOF(kYearsTagUChar)), kYearsTagUChar, 0, UPRV_LENGTHOF(kYearsTagUChar)) == 0
+                    || path.compare(startIndex, (length = UPRV_LENGTHOF(kDayPartsTagUChar)), kDayPartsTagUChar, 0, UPRV_LENGTHOF(kDayPartsTagUChar)) == 0) {
+                    startIndex += length;
+                    length = 0;
+                    if (startIndex == path.length()
+                        || path.compare(startIndex, (length = UPRV_LENGTHOF(kFormatTagUChar)), kFormatTagUChar, 0, UPRV_LENGTHOF(kFormatTagUChar)) == 0) {
+                        startIndex += length;
+                        length = 0;
+                        if (startIndex == path.length()
+                            || path.compare(startIndex, (length = UPRV_LENGTHOF(kAbbrTagUChar)), kAbbrTagUChar, 0, UPRV_LENGTHOF(kAbbrTagUChar)) == 0) {
+                            skip = FALSE;
+                        }
+                    }
+                }
+                if (skip) {
+                    // Drop the latest key on the path and continue
+                    path.retainBetween(0, pathLength);
+                    continue;
+                }
+            }
+
+            // == Handle aliases ==
+            if (arrays.get(path) != NULL || maps.get(path) != NULL) {
+                // Drop the latest key on the path and continue
+                path.retainBetween(0, pathLength);
+                continue;
+            }
+
+            AliasType aliasType = processAliasFromValue(path, value, errorCode);
+            if (U_FAILURE(errorCode)) { return; }
+            if (aliasType == SAME_CALENDAR) {
+                // Store the alias path and the current path on aliasPathPairs
+                LocalPointer<UnicodeString> aliasRelativePathCopy(new UnicodeString(aliasRelativePath), errorCode);
+                aliasPathPairs.addElement(aliasRelativePathCopy.getAlias(), errorCode);
+                if (U_FAILURE(errorCode)) { return; }
+                // Only release ownership after aliasPathPairs takes it (no error happened):
+                aliasRelativePathCopy.orphan();
+                LocalPointer<UnicodeString> pathCopy(new UnicodeString(path), errorCode);
+                aliasPathPairs.addElement(pathCopy.getAlias(), errorCode);
+                if (U_FAILURE(errorCode)) { return; }
+                // Only release ownership after aliasPathPairs takes it (no error happened):
+                pathCopy.orphan();
+
+                // Drop the latest key on the path and continue
+                path.retainBetween(0, pathLength);
+                continue;
+            }
+            U_ASSERT(aliasType == NONE);
+
+            // == Handle data ==
+            if (value.getType() == URES_ARRAY) {
+                // We are on a leaf, store the array
+                ResourceArray rDataArray = value.getArray(errorCode);
+                int32_t dataArraySize = rDataArray.getSize();
+                LocalArray<UnicodeString> dataArray(new UnicodeString[dataArraySize], errorCode);
+                value.getStringArray(dataArray.getAlias(), dataArraySize, errorCode);
+                arrays.put(path, dataArray.orphan(), errorCode);
+                arraySizes.puti(path, dataArraySize, errorCode);
+                if (U_FAILURE(errorCode)) { return; }
+            } else if (value.getType() == URES_TABLE) {
+                // We are not on a leaf, recursively process the subtable.
+                processResource(path, key, value, errorCode);
+                if (U_FAILURE(errorCode)) { return; }
+            }
+
+            // Drop the latest key on the path
+            path.retainBetween(0, pathLength);
+        }
+    }
+
+    // Populates an AliasIdentifier with the alias information contained on the UResource.Value.
+    AliasType processAliasFromValue(UnicodeString &currentRelativePath, ResourceValue &value,
+                                    UErrorCode &errorCode) {
+        if (U_FAILURE(errorCode)) { return NONE; }
+
+        if (value.getType() == URES_ALIAS) {
+            int32_t aliasPathSize;
+            const UChar* aliasPathUChar = value.getAliasString(aliasPathSize, errorCode);
+            if (U_FAILURE(errorCode)) { return NONE; }
+            UnicodeString aliasPath(aliasPathUChar, aliasPathSize);
+            const int32_t aliasPrefixLength = UPRV_LENGTHOF(kCalendarAliasPrefixUChar);
+            if (aliasPath.startsWith(kCalendarAliasPrefixUChar, aliasPrefixLength)
+                && aliasPath.length() > aliasPrefixLength) {
+                int32_t typeLimit = aliasPath.indexOf(SOLIDUS, aliasPrefixLength);
+                if (typeLimit > aliasPrefixLength) {
+                    const UnicodeString aliasCalendarType =
+                        aliasPath.tempSubStringBetween(aliasPrefixLength, typeLimit);
+                    aliasRelativePath.setTo(aliasPath, typeLimit + 1, aliasPath.length());
+
+                    if (currentCalendarType == aliasCalendarType
+                        && currentRelativePath != aliasRelativePath) {
+                        // If we have an alias to the same calendar, the path to the resource must be different
+                        return SAME_CALENDAR;
+
+                    } else if (currentCalendarType != aliasCalendarType
+                               && currentRelativePath == aliasRelativePath) {
+                        // If we have an alias to a different calendar, the path to the resource must be the same
+                        if (aliasCalendarType.compare(kGregorianTagUChar, UPRV_LENGTHOF(kGregorianTagUChar)) == 0) {
+                            return GREGORIAN;
+                        } else if (nextCalendarType.isBogus()) {
+                            nextCalendarType = aliasCalendarType;
+                            return DIFFERENT_CALENDAR;
+                        } else if (nextCalendarType == aliasCalendarType) {
+                            return DIFFERENT_CALENDAR;
+                        }
+                    }
+                }
+            }
+            errorCode = U_INTERNAL_PROGRAM_ERROR;
+            return NONE;
         }
+        return NONE;
+    }
+
+    // Deleter function to be used by 'arrays'
+    static void U_CALLCONV deleteUnicodeStringArray(void *uArray) {
+        delete[] static_cast<UnicodeString *>(uArray);
     }
+};
+// Virtual destructors have to be defined out of line
+CalendarDataSink::~CalendarDataSink() {
+    arrays.setValueDeleter(deleteUnicodeStringArray);
 }
+}
+
+//------------------------------------------------------
 
 static void
 initField(UnicodeString **field, int32_t& length, const UChar *data, LastResortSize numStr, LastResortSize strLen, UErrorCode &status) {
@@ -1080,43 +1869,199 @@ initField(UnicodeString **field, int32_t& length, const UChar *data, LastResortS
     }
 }
 
-void
-DateFormatSymbols::initializeData(const Locale& locale, const char *type, UErrorCode& status, UBool useLastResortData)
-{
-    int32_t i;
-    int32_t len = 0;
-    const UChar *resStr;
-    /* In case something goes wrong, initialize all of the data to NULL. */
-    fEras = NULL;
-    fErasCount = 0;
-    fEraNames = NULL;
-    fEraNamesCount = 0;
-    fMonths = NULL;
-    fMonthsCount=0;
-    fShortMonths = NULL;
-    fShortMonthsCount=0;
-    fNarrowMonths = NULL;
-    fNarrowMonthsCount=0;
-    fStandaloneMonths = NULL;
-    fStandaloneMonthsCount=0;
-    fStandaloneShortMonths = NULL;
-    fStandaloneShortMonthsCount=0;
+static void
+initField(UnicodeString **field, int32_t& length, CalendarDataSink &sink, CharString &key, UErrorCode &status) {
+    if (U_SUCCESS(status)) {
+        UnicodeString keyUString(key.data(), -1, US_INV);
+        UnicodeString* array = static_cast<UnicodeString*>(sink.arrays.get(keyUString));
+
+        if (array != NULL) {
+            length = sink.arraySizes.geti(keyUString);
+            *field = array;
+            // DateFormatSymbols takes ownership of the array:
+            sink.arrays.remove(keyUString);
+        } else {
+            length = 0;
+            status = U_MISSING_RESOURCE_ERROR;
+        }
+    }
+}
+
+static void
+initField(UnicodeString **field, int32_t& length, CalendarDataSink &sink, CharString &key, int32_t arrayOffset, UErrorCode &status) {
+    if (U_SUCCESS(status)) {
+        UnicodeString keyUString(key.data(), -1, US_INV);
+        UnicodeString* array = static_cast<UnicodeString*>(sink.arrays.get(keyUString));
+
+        if (array != NULL) {
+            int32_t arrayLength = sink.arraySizes.geti(keyUString);
+            length = arrayLength + arrayOffset;
+            *field = new UnicodeString[length];
+            if (*field == NULL) {
+                status = U_MEMORY_ALLOCATION_ERROR;
+                return;
+            }
+            uprv_arrayCopy(array, 0, *field, arrayOffset, arrayLength);
+        } else {
+            length = 0;
+            status = U_MISSING_RESOURCE_ERROR;
+        }
+    }
+}
+
+static void
+initLeapMonthPattern(UnicodeString *field, int32_t index, CalendarDataSink &sink, CharString &path, UErrorCode &status) {
+    field[index].remove();
+    if (U_SUCCESS(status)) {
+        UnicodeString pathUString(path.data(), -1, US_INV);
+        Hashtable *leapMonthTable = static_cast<Hashtable*>(sink.maps.get(pathUString));
+        if (leapMonthTable != NULL) {
+            UnicodeString leapLabel(FALSE, kLeapTagUChar, UPRV_LENGTHOF(kLeapTagUChar));
+            UnicodeString *leapMonthPattern = static_cast<UnicodeString*>(leapMonthTable->get(leapLabel));
+            if (leapMonthPattern != NULL) {
+                field[index].fastCopyFrom(*leapMonthPattern);
+            } else {
+                field[index].setToBogus();
+            }
+            return;
+        }
+        status = U_MISSING_RESOURCE_ERROR;
+    }
+}
+
+static CharString
+&buildResourcePath(CharString &path, const char* segment1, UErrorCode &errorCode) {
+    return path.clear().append(segment1, -1, errorCode);
+}
+
+static CharString
+&buildResourcePath(CharString &path, const char* segment1, const char* segment2,
+                   UErrorCode &errorCode) {
+    return buildResourcePath(path, segment1, errorCode).append('/', errorCode)
+                                                       .append(segment2, -1, errorCode);
+}
+
+static CharString
+&buildResourcePath(CharString &path, const char* segment1, const char* segment2,
+                   const char* segment3, UErrorCode &errorCode) {
+    return buildResourcePath(path, segment1, segment2, errorCode).append('/', errorCode)
+                                                                 .append(segment3, -1, errorCode);
+}
+
+static CharString
+&buildResourcePath(CharString &path, const char* segment1, const char* segment2,
+                   const char* segment3, const char* segment4, UErrorCode &errorCode) {
+    return buildResourcePath(path, segment1, segment2, segment3, errorCode).append('/', errorCode)
+                                                                           .append(segment4, -1, errorCode);
+}
+
+typedef struct {
+    const char * usageTypeName;
+    DateFormatSymbols::ECapitalizationContextUsageType usageTypeEnumValue;
+} ContextUsageTypeNameToEnumValue;
+
+static const ContextUsageTypeNameToEnumValue contextUsageTypeMap[] = {
+   // Entries must be sorted by usageTypeName; entry with NULL name terminates list.
+    { "day-format-except-narrow", DateFormatSymbols::kCapContextUsageDayFormat },
+    { "day-narrow",     DateFormatSymbols::kCapContextUsageDayNarrow },
+    { "day-standalone-except-narrow", DateFormatSymbols::kCapContextUsageDayStandalone },
+    { "era-abbr",       DateFormatSymbols::kCapContextUsageEraAbbrev },
+    { "era-name",       DateFormatSymbols::kCapContextUsageEraWide },
+    { "era-narrow",     DateFormatSymbols::kCapContextUsageEraNarrow },
+    { "metazone-long",  DateFormatSymbols::kCapContextUsageMetazoneLong },
+    { "metazone-short", DateFormatSymbols::kCapContextUsageMetazoneShort },
+    { "month-format-except-narrow", DateFormatSymbols::kCapContextUsageMonthFormat },
+    { "month-narrow",   DateFormatSymbols::kCapContextUsageMonthNarrow },
+    { "month-standalone-except-narrow", DateFormatSymbols::kCapContextUsageMonthStandalone },
+    { "zone-long",      DateFormatSymbols::kCapContextUsageZoneLong },
+    { "zone-short",     DateFormatSymbols::kCapContextUsageZoneShort },
+    { NULL, (DateFormatSymbols::ECapitalizationContextUsageType)0 },
+};
+
+// Resource keys to look up localized strings for day periods.
+// The first one must be midnight and the second must be noon, so that their indices coincide
+// with the am/pm field. Formatting and parsing code for day periods relies on this coincidence.
+static const char *dayPeriodKeys[] = {"midnight", "noon",
+                         "morning1", "afternoon1", "evening1", "night1",
+                         "morning2", "afternoon2", "evening2", "night2"};
+
+UnicodeString* loadDayPeriodStrings(CalendarDataSink &sink, CharString &path,
+                                    int32_t &stringCount,  UErrorCode &status) {
+    if (U_FAILURE(status)) { return NULL; }
+
+    UnicodeString pathUString(path.data(), -1, US_INV);
+    Hashtable* map = static_cast<Hashtable*>(sink.maps.get(pathUString));
+
+    stringCount = UPRV_LENGTHOF(dayPeriodKeys);
+    UnicodeString *strings = new UnicodeString[stringCount];
+    if (strings == NULL) {
+        status = U_MEMORY_ALLOCATION_ERROR;
+        return NULL;
+    }
+
+    if (map != NULL) {
+        for (int32_t i = 0; i < stringCount; ++i) {
+            UnicodeString dayPeriodKey(dayPeriodKeys[i], -1, US_INV);
+            UnicodeString *dayPeriod = static_cast<UnicodeString*>(map->get(dayPeriodKey));
+            if (dayPeriod != NULL) {
+                strings[i].fastCopyFrom(*dayPeriod);
+            } else {
+                strings[i].setToBogus();
+            }
+        }
+    } else {
+        for (int32_t i = 0; i < stringCount; i++) {
+            strings[i].setToBogus();
+        }
+    }
+    return strings;
+}
+
+
+void
+DateFormatSymbols::initializeData(const Locale& locale, const char *type, UErrorCode& status, UBool useLastResortData)
+{
+    int32_t len = 0;
+    /* In case something goes wrong, initialize all of the data to NULL. */
+    fEras = NULL;
+    fErasCount = 0;
+    fEraNames = NULL;
+    fEraNamesCount = 0;
+    fNarrowEras = NULL;
+    fNarrowErasCount = 0;
+    fMonths = NULL;
+    fMonthsCount=0;
+    fShortMonths = NULL;
+    fShortMonthsCount=0;
+    fNarrowMonths = NULL;
+    fNarrowMonthsCount=0;
+    fStandaloneMonths = NULL;
+    fStandaloneMonthsCount=0;
+    fStandaloneShortMonths = NULL;
+    fStandaloneShortMonthsCount=0;
     fStandaloneNarrowMonths = NULL;
     fStandaloneNarrowMonthsCount=0;
     fWeekdays = NULL;
     fWeekdaysCount=0;
     fShortWeekdays = NULL;
     fShortWeekdaysCount=0;
+    fShorterWeekdays = NULL;
+    fShorterWeekdaysCount=0;
     fNarrowWeekdays = NULL;
     fNarrowWeekdaysCount=0;
     fStandaloneWeekdays = NULL;
     fStandaloneWeekdaysCount=0;
     fStandaloneShortWeekdays = NULL;
     fStandaloneShortWeekdaysCount=0;
+    fStandaloneShorterWeekdays = NULL;
+    fStandaloneShorterWeekdaysCount=0;
     fStandaloneNarrowWeekdays = NULL;
     fStandaloneNarrowWeekdaysCount=0;
     fAmPms = NULL;
     fAmPmsCount=0;
+    fNarrowAmPms = NULL;
+    fNarrowAmPmsCount=0;
+    fTimeSeparator.setToBogus();
     fQuarters = NULL;
     fQuartersCount = 0;
     fShortQuarters = NULL;
@@ -1125,135 +2070,301 @@ DateFormatSymbols::initializeData(const Locale& locale, const char *type, UError
     fStandaloneQuartersCount = 0;
     fStandaloneShortQuarters = NULL;
     fStandaloneShortQuartersCount = 0;
+    fLeapMonthPatterns = NULL;
+    fLeapMonthPatternsCount = 0;
+    fShortYearNames = NULL;
+    fShortYearNamesCount = 0;
+    fShortZodiacNames = NULL;
+    fShortZodiacNamesCount = 0;
     fZoneStringsRowCount = 0;
     fZoneStringsColCount = 0;
     fZoneStrings = NULL;
-    fZoneStringsHash = NULL;
-    fZoneIDEnumeration = NULL;
-    fResourceBundle   = NULL;
-    
-      
+    fLocaleZoneStrings = NULL;
+    fAbbreviatedDayPeriods = NULL;
+    fAbbreviatedDayPeriodsCount = 0;
+    fWideDayPeriods = NULL;
+    fWideDayPeriodsCount = 0;
+    fNarrowDayPeriods = NULL;
+    fNarrowDayPeriodsCount = 0;
+    fStandaloneAbbreviatedDayPeriods = NULL;
+    fStandaloneAbbreviatedDayPeriodsCount = 0;
+    fStandaloneWideDayPeriods = NULL;
+    fStandaloneWideDayPeriodsCount = 0;
+    fStandaloneNarrowDayPeriods = NULL;
+    fStandaloneNarrowDayPeriodsCount = 0;
+    uprv_memset(fCapitalization, 0, sizeof(fCapitalization));
+
+    // We need to preserve the requested locale for
+    // lazy ZoneStringFormat instantiation.  ZoneStringFormat
+    // is region sensitive, thus, bundle locale bundle's locale
+    // is not sufficient.
+    fZSFLocale = locale;
+
     if (U_FAILURE(status)) return;
 
-    /**
-     * Retrieve the string arrays we need from the resource bundle file.
-     * We cast away const here, but that's okay; we won't delete any of
-     * these.
-     */
-    CalendarData calData(locale, type, status);
-    fResourceBundle = ures_open((char*)0, locale.getName(), &status);
+    // Create a CalendarDataSink to process this data and the resouce bundles
+    CalendarDataSink calendarSink(status);
+    UResourceBundle *rb = ures_open(NULL, locale.getBaseName(), &status);
+    UResourceBundle *cb = ures_getByKey(rb, gCalendarTag, NULL, &status);
 
-    // load the first data item
-    UResourceBundle *erasMain = calData.getByKey(gErasTag, status);
-    UResourceBundle *eras = ures_getByKeyWithFallback(erasMain, gAbbreviatedTag, NULL, &status);
-    UErrorCode oldStatus = status;
-    UResourceBundle *eraNames = ures_getByKeyWithFallback(erasMain, gNamesWideTag, NULL, &status);
-    if ( status == U_MISSING_RESOURCE_ERROR ) { // Workaround because eras/wide was omitted from CLDR 1.3
-       status = oldStatus;
-       eraNames = ures_getByKeyWithFallback(erasMain, gAbbreviatedTag, NULL, &status);
-    }
+    if (U_FAILURE(status)) return;
 
-    UResourceBundle *lsweekdaysData = NULL; // Data closed by calData
-    UResourceBundle *weekdaysData = NULL; // Data closed by calData
-    UResourceBundle *narrowWeekdaysData = NULL; // Data closed by calData
-    UResourceBundle *standaloneWeekdaysData = NULL; // Data closed by calData
-    UResourceBundle *standaloneShortWeekdaysData = NULL; // Data closed by calData
-    UResourceBundle *standaloneNarrowWeekdaysData = NULL; // Data closed by calData
+    // Iterate over the resource bundle data following the fallbacks through different calendar types
+    UnicodeString calendarType((type != NULL && *type != '\0')? type : gGregorianTag, -1, US_INV);
+    while (!calendarType.isBogus()) {
+        CharString calendarTypeBuffer;
+        calendarTypeBuffer.appendInvariantChars(calendarType, status);
+        if (U_FAILURE(status)) { return; }
+        const char *calendarTypeCArray = calendarTypeBuffer.data();
+
+        // Enumerate this calendar type. If the calendar is not found fallback to gregorian
+        UErrorCode oldStatus = status;
+        UResourceBundle *ctb = ures_getByKeyWithFallback(cb, calendarTypeCArray, NULL, &status);
+        if (status == U_MISSING_RESOURCE_ERROR) {
+            ures_close(ctb);
+            if (uprv_strcmp(calendarTypeCArray, gGregorianTag) != 0) {
+                calendarType.setTo(FALSE, kGregorianTagUChar, UPRV_LENGTHOF(kGregorianTagUChar));
+                calendarSink.visitAllResources();
+                status = oldStatus;
+                continue;
+            }
+            return;
+        }
 
-    U_LOCALE_BASED(locBased, *this);
-    if (U_FAILURE(status))
-    {
-        if (useLastResortData)
-        {
-            // Handle the case in which there is no resource data present.
-            // We don't have to generate usable patterns in this situation;
-            // we just need to produce something that will be semi-intelligible
-            // in most locales.
+        calendarSink.preEnumerate(calendarType);
+        ures_getAllItemsWithFallback(ctb, "", calendarSink, status);
+        ures_close(ctb);
+        if (U_FAILURE(status)) break;
 
-            status = U_USING_FALLBACK_WARNING;
+        // Stop loading when gregorian was loaded
+        if (uprv_strcmp(calendarTypeCArray, gGregorianTag) == 0) {
+            break;
+        }
 
-            initField(&fEras, fErasCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
-            initField(&fEraNames, fEraNamesCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
-            initField(&fMonths, fMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
-            initField(&fShortMonths, fShortMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fNarrowMonths, fNarrowMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fStandaloneMonths, fStandaloneMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
-            initField(&fStandaloneShortMonths, fStandaloneShortMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fWeekdays, fWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fShortWeekdays, fShortWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fNarrowWeekdays, fNarrowWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fStandaloneWeekdays, fStandaloneWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fAmPms, fAmPmsCount, (const UChar *)gLastResortAmPmMarkers, kAmPmNum, kAmPmLen, status);
-            initField(&fQuarters, fQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fShortQuarters, fShortQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fStandaloneQuarters, fStandaloneQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fStandaloneShortQuarters, fStandaloneShortQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            fLocalPatternChars = gPatternChars;
+        // Get the next calendar type to process from the sink
+        calendarType = calendarSink.nextCalendarType;
+
+        // Gregorian is always the last fallback
+        if (calendarType.isBogus()) {
+            calendarType.setTo(FALSE, kGregorianTagUChar, UPRV_LENGTHOF(kGregorianTagUChar));
+            calendarSink.visitAllResources();
+        }
+    }
+
+    // CharString object to build paths
+    CharString path;
+
+    // Load Leap Month Patterns
+    UErrorCode tempStatus = status;
+    fLeapMonthPatterns = newUnicodeStringArray(kMonthPatternsCount);
+    if (fLeapMonthPatterns) {
+        initLeapMonthPattern(fLeapMonthPatterns, kLeapMonthPatternFormatWide, calendarSink,
+                             buildResourcePath(path, gMonthPatternsTag, gNamesFormatTag, gNamesWideTag, tempStatus), tempStatus);
+        initLeapMonthPattern(fLeapMonthPatterns, kLeapMonthPatternFormatAbbrev, calendarSink,
+                             buildResourcePath(path, gMonthPatternsTag, gNamesFormatTag, gNamesAbbrTag, tempStatus), tempStatus);
+        initLeapMonthPattern(fLeapMonthPatterns, kLeapMonthPatternFormatNarrow, calendarSink,
+                             buildResourcePath(path, gMonthPatternsTag, gNamesFormatTag, gNamesNarrowTag, tempStatus), tempStatus);
+        initLeapMonthPattern(fLeapMonthPatterns, kLeapMonthPatternStandaloneWide, calendarSink,
+                             buildResourcePath(path, gMonthPatternsTag, gNamesStandaloneTag, gNamesWideTag, tempStatus), tempStatus);
+        initLeapMonthPattern(fLeapMonthPatterns, kLeapMonthPatternStandaloneAbbrev, calendarSink,
+                             buildResourcePath(path, gMonthPatternsTag, gNamesStandaloneTag, gNamesAbbrTag, tempStatus), tempStatus);
+        initLeapMonthPattern(fLeapMonthPatterns, kLeapMonthPatternStandaloneNarrow, calendarSink,
+                             buildResourcePath(path, gMonthPatternsTag, gNamesStandaloneTag, gNamesNarrowTag, tempStatus), tempStatus);
+        initLeapMonthPattern(fLeapMonthPatterns, kLeapMonthPatternNumeric, calendarSink,
+                             buildResourcePath(path, gMonthPatternsTag, gNamesNumericTag, gNamesAllTag, tempStatus), tempStatus);
+        if (U_SUCCESS(tempStatus)) {
+            // Hack to fix bad C inheritance for dangi monthPatterns (OK in J); this should be handled by aliases in root, but isn't.
+            // The ordering of the following statements is important.
+            if (fLeapMonthPatterns[kLeapMonthPatternFormatAbbrev].isEmpty()) {
+                fLeapMonthPatterns[kLeapMonthPatternFormatAbbrev].setTo(fLeapMonthPatterns[kLeapMonthPatternFormatWide]);
+            };
+            if (fLeapMonthPatterns[kLeapMonthPatternFormatNarrow].isEmpty()) {
+                fLeapMonthPatterns[kLeapMonthPatternFormatNarrow].setTo(fLeapMonthPatterns[kLeapMonthPatternStandaloneNarrow]);
+            };
+            if (fLeapMonthPatterns[kLeapMonthPatternStandaloneWide].isEmpty()) {
+                fLeapMonthPatterns[kLeapMonthPatternStandaloneWide].setTo(fLeapMonthPatterns[kLeapMonthPatternFormatWide]);
+            };
+            if (fLeapMonthPatterns[kLeapMonthPatternStandaloneAbbrev].isEmpty()) {
+                fLeapMonthPatterns[kLeapMonthPatternStandaloneAbbrev].setTo(fLeapMonthPatterns[kLeapMonthPatternFormatAbbrev]);
+            };
+            // end of hack
+            fLeapMonthPatternsCount = kMonthPatternsCount;
+        } else {
+            delete[] fLeapMonthPatterns;
+            fLeapMonthPatterns = NULL;
         }
-        goto cleanup;
     }
 
+    // Load cyclic names sets
+    tempStatus = status;
+    initField(&fShortYearNames, fShortYearNamesCount, calendarSink,
+              buildResourcePath(path, gCyclicNameSetsTag, gNameSetYearsTag, gNamesFormatTag, gNamesAbbrTag, tempStatus), tempStatus);
+    initField(&fShortZodiacNames, fShortZodiacNamesCount, calendarSink,
+              buildResourcePath(path, gCyclicNameSetsTag, gNameSetZodiacsTag, gNamesFormatTag, gNamesAbbrTag, tempStatus), tempStatus);
+
+    // Load context transforms and capitalization
+    tempStatus = U_ZERO_ERROR;
+    UResourceBundle *localeBundle = ures_open(NULL, locale.getName(), &tempStatus);
+    if (U_SUCCESS(tempStatus)) {
+        UResourceBundle *contextTransforms = ures_getByKeyWithFallback(localeBundle, gContextTransformsTag, NULL, &tempStatus);
+        if (U_SUCCESS(tempStatus)) {
+            UResourceBundle *contextTransformUsage;
+            while ( (contextTransformUsage = ures_getNextResource(contextTransforms, NULL, &tempStatus)) != NULL ) {
+                const int32_t * intVector = ures_getIntVector(contextTransformUsage, &len, &status);
+                if (U_SUCCESS(tempStatus) && intVector != NULL && len >= 2) {
+                    const char* usageType = ures_getKey(contextTransformUsage);
+                    if (usageType != NULL) {
+                        const ContextUsageTypeNameToEnumValue * typeMapPtr = contextUsageTypeMap;
+                        int32_t compResult = 0;
+                        // linear search; list is short and we cannot be sure that bsearch is available
+                        while ( typeMapPtr->usageTypeName != NULL && (compResult = uprv_strcmp(usageType, typeMapPtr->usageTypeName)) > 0 ) {
+                            ++typeMapPtr;
+                        }
+                        if (typeMapPtr->usageTypeName != NULL && compResult == 0) {
+                            fCapitalization[typeMapPtr->usageTypeEnumValue][0] = static_cast<UBool>(intVector[0]);
+                            fCapitalization[typeMapPtr->usageTypeEnumValue][1] = static_cast<UBool>(intVector[1]);
+                        }
+                    }
+                }
+                tempStatus = U_ZERO_ERROR;
+                ures_close(contextTransformUsage);
+            }
+            ures_close(contextTransforms);
+        }
+
+        tempStatus = U_ZERO_ERROR;
+        const LocalPointer<NumberingSystem> numberingSystem(
+                NumberingSystem::createInstance(locale, tempStatus), tempStatus);
+        if (U_SUCCESS(tempStatus)) {
+            // These functions all fail gracefully if passed NULL pointers and
+            // do nothing unless U_SUCCESS(tempStatus), so it's only necessary
+            // to check for errors once after all calls are made.
+            const LocalUResourceBundlePointer numberElementsData(ures_getByKeyWithFallback(
+                    localeBundle, gNumberElementsTag, NULL, &tempStatus));
+            const LocalUResourceBundlePointer nsNameData(ures_getByKeyWithFallback(
+                    numberElementsData.getAlias(), numberingSystem->getName(), NULL, &tempStatus));
+            const LocalUResourceBundlePointer symbolsData(ures_getByKeyWithFallback(
+                    nsNameData.getAlias(), gSymbolsTag, NULL, &tempStatus));
+            fTimeSeparator = ures_getUnicodeStringByKey(
+                    symbolsData.getAlias(), gTimeSeparatorTag, &tempStatus);
+            if (U_FAILURE(tempStatus)) {
+                fTimeSeparator.setToBogus();
+            }
+        }
+
+        ures_close(localeBundle);
+    }
+
+    if (fTimeSeparator.isBogus()) {
+        fTimeSeparator.setTo(DateFormatSymbols::DEFAULT_TIME_SEPARATOR);
+    }
+
+    // Load day periods
+    fWideDayPeriods = loadDayPeriodStrings(calendarSink,
+                            buildResourcePath(path, gDayPeriodTag, gNamesFormatTag, gNamesWideTag, status),
+                            fWideDayPeriodsCount, status);
+    fNarrowDayPeriods = loadDayPeriodStrings(calendarSink,
+                            buildResourcePath(path, gDayPeriodTag, gNamesFormatTag, gNamesNarrowTag, status),
+                            fNarrowDayPeriodsCount, status);
+    fAbbreviatedDayPeriods = loadDayPeriodStrings(calendarSink,
+                            buildResourcePath(path, gDayPeriodTag, gNamesFormatTag, gNamesAbbrTag, status),
+                            fAbbreviatedDayPeriodsCount, status);
+    fStandaloneWideDayPeriods = loadDayPeriodStrings(calendarSink,
+                            buildResourcePath(path, gDayPeriodTag, gNamesStandaloneTag, gNamesWideTag, status),
+                            fStandaloneWideDayPeriodsCount, status);
+    fStandaloneNarrowDayPeriods = loadDayPeriodStrings(calendarSink,
+                            buildResourcePath(path, gDayPeriodTag, gNamesStandaloneTag, gNamesNarrowTag, status),
+                            fStandaloneNarrowDayPeriodsCount, status);
+    fStandaloneAbbreviatedDayPeriods = loadDayPeriodStrings(calendarSink,
+                            buildResourcePath(path, gDayPeriodTag, gNamesStandaloneTag, gNamesAbbrTag, status),
+                            fStandaloneAbbreviatedDayPeriodsCount, status);
+
+    U_LOCALE_BASED(locBased, *this);
     // if we make it to here, the resource data is cool, and we can get everything out
     // of it that we need except for the time-zone and localized-pattern data, which
     // are stored in a separate file
-    locBased.setLocaleIDs(ures_getLocaleByType(eras, ULOC_VALID_LOCALE, &status),
-                          ures_getLocaleByType(eras, ULOC_ACTUAL_LOCALE, &status));
-
-    initField(&fEras, fErasCount, eras, status);
-    initField(&fEraNames, fEraNamesCount, eraNames, status);
+    locBased.setLocaleIDs(ures_getLocaleByType(cb, ULOC_VALID_LOCALE, &status),
+                          ures_getLocaleByType(cb, ULOC_ACTUAL_LOCALE, &status));
 
-    initField(&fMonths, fMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesWideTag, status), status);
-    initField(&fShortMonths, fShortMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesAbbrTag, status), status);
-
-    initField(&fNarrowMonths, fNarrowMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesNarrowTag, status), status);
-    if(status == U_MISSING_RESOURCE_ERROR) {
+    // Load eras
+    initField(&fEras, fErasCount, calendarSink, buildResourcePath(path, gErasTag, gNamesAbbrTag, status), status);
+    UErrorCode oldStatus = status;
+    initField(&fEraNames, fEraNamesCount, calendarSink, buildResourcePath(path, gErasTag, gNamesWideTag, status), status);
+    if (status == U_MISSING_RESOURCE_ERROR) { // Workaround because eras/wide was omitted from CLDR 1.3
+        status = oldStatus;
+        assignArray(fEraNames, fEraNamesCount, fEras, fErasCount);
+    }
+    // current ICU4J falls back to abbreviated if narrow eras are missing, so we will too
+    oldStatus = status;
+    initField(&fNarrowEras, fNarrowErasCount, calendarSink, buildResourcePath(path, gErasTag, gNamesNarrowTag, status), status);
+    if (status == U_MISSING_RESOURCE_ERROR) { // Workaround because eras/wide was omitted from CLDR 1.3
+        status = oldStatus;
+        assignArray(fNarrowEras, fNarrowErasCount, fEras, fErasCount);
+    }
+
+    // Load month names
+    initField(&fMonths, fMonthsCount, calendarSink,
+              buildResourcePath(path, gMonthNamesTag, gNamesFormatTag, gNamesWideTag, status), status);
+    initField(&fShortMonths, fShortMonthsCount, calendarSink,
+              buildResourcePath(path, gMonthNamesTag, gNamesFormatTag, gNamesAbbrTag, status), status);
+    initField(&fStandaloneMonths, fStandaloneMonthsCount, calendarSink,
+              buildResourcePath(path, gMonthNamesTag, gNamesStandaloneTag, gNamesWideTag, status), status);
+    if (status == U_MISSING_RESOURCE_ERROR) { /* If standalone/wide not available, use format/wide */
         status = U_ZERO_ERROR;
-        initField(&fNarrowMonths, fNarrowMonthsCount, calData.getByKey3(gMonthNamesTag, gNamesStandaloneTag, gNamesNarrowTag, status), status);
+        assignArray(fStandaloneMonths, fStandaloneMonthsCount, fMonths, fMonthsCount);
     }
-    if ( status == U_MISSING_RESOURCE_ERROR ) { /* If format/narrow not available, use format/abbreviated */
-       status = U_ZERO_ERROR;
-       initField(&fNarrowMonths, fNarrowMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesAbbrTag, status), status);
-    }
-
-    initField(&fStandaloneMonths, fStandaloneMonthsCount, calData.getByKey3(gMonthNamesTag, gNamesStandaloneTag, gNamesWideTag, status), status);
-    if ( status == U_MISSING_RESOURCE_ERROR ) { /* If standalone/wide not available, use format/wide */
-       status = U_ZERO_ERROR;
-       initField(&fStandaloneMonths, fStandaloneMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesWideTag, status), status);
-    }
-    initField(&fStandaloneShortMonths, fStandaloneShortMonthsCount, calData.getByKey3(gMonthNamesTag, gNamesStandaloneTag, gNamesAbbrTag, status), status);
-    if ( status == U_MISSING_RESOURCE_ERROR ) { /* If standalone/abbreviated not available, use format/abbreviated */
-       status = U_ZERO_ERROR;
-       initField(&fStandaloneShortMonths, fStandaloneShortMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesAbbrTag, status), status);
-    }
-    initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, calData.getByKey3(gMonthNamesTag, gNamesStandaloneTag, gNamesNarrowTag, status), status);
-    if ( status == U_MISSING_RESOURCE_ERROR ) { /* if standalone/narrow not availabe, try format/narrow */
-       status = U_ZERO_ERROR;
-       initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesNarrowTag, status), status);
-       if ( status == U_MISSING_RESOURCE_ERROR ) { /* if still not there, use format/abbreviated */
-          status = U_ZERO_ERROR;
-          initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, calData.getByKey2(gMonthNamesTag, gNamesAbbrTag, status), status);
-       }
-    }
-    initField(&fAmPms, fAmPmsCount, calData.getByKey(gAmPmMarkersTag, status), status);
-
-    initField(&fQuarters, fQuartersCount, calData.getByKey2(gQuartersTag, gNamesWideTag, status), status);
-    initField(&fShortQuarters, fShortQuartersCount, calData.getByKey2(gQuartersTag, gNamesAbbrTag, status), status);
-
-    initField(&fStandaloneQuarters, fStandaloneQuartersCount, calData.getByKey3(gQuartersTag, gNamesStandaloneTag, gNamesWideTag, status), status);
+    initField(&fStandaloneShortMonths, fStandaloneShortMonthsCount, calendarSink,
+              buildResourcePath(path, gMonthNamesTag, gNamesStandaloneTag, gNamesAbbrTag, status), status);
+    if (status == U_MISSING_RESOURCE_ERROR) { /* If standalone/abbreviated not available, use format/abbreviated */
+        status = U_ZERO_ERROR;
+        assignArray(fStandaloneShortMonths, fStandaloneShortMonthsCount, fShortMonths, fShortMonthsCount);
+    }
+
+    UErrorCode narrowMonthsEC = status;
+    UErrorCode standaloneNarrowMonthsEC = status;
+    initField(&fNarrowMonths, fNarrowMonthsCount, calendarSink,
+              buildResourcePath(path, gMonthNamesTag, gNamesFormatTag, gNamesNarrowTag, narrowMonthsEC), narrowMonthsEC);
+    initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, calendarSink,
+              buildResourcePath(path, gMonthNamesTag, gNamesStandaloneTag, gNamesNarrowTag, narrowMonthsEC), standaloneNarrowMonthsEC);
+    if (narrowMonthsEC == U_MISSING_RESOURCE_ERROR && standaloneNarrowMonthsEC != U_MISSING_RESOURCE_ERROR) {
+        // If format/narrow not available, use standalone/narrow
+        assignArray(fNarrowMonths, fNarrowMonthsCount, fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount);
+    } else if (narrowMonthsEC != U_MISSING_RESOURCE_ERROR && standaloneNarrowMonthsEC == U_MISSING_RESOURCE_ERROR) {
+        // If standalone/narrow not availabe, use format/narrow
+        assignArray(fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, fNarrowMonths, fNarrowMonthsCount);
+    } else if (narrowMonthsEC == U_MISSING_RESOURCE_ERROR && standaloneNarrowMonthsEC == U_MISSING_RESOURCE_ERROR) {
+        // If neither is available, use format/abbreviated
+        assignArray(fNarrowMonths, fNarrowMonthsCount, fShortMonths, fShortMonthsCount);
+        assignArray(fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, fShortMonths, fShortMonthsCount);
+    }
+
+    // Load AM/PM markers
+    initField(&fAmPms, fAmPmsCount, calendarSink,
+              buildResourcePath(path, gAmPmMarkersTag, status), status);
+    initField(&fNarrowAmPms, fNarrowAmPmsCount, calendarSink,
+              buildResourcePath(path, gAmPmMarkersNarrowTag, status), status);
+
+    // Load quarters
+    initField(&fQuarters, fQuartersCount, calendarSink,
+              buildResourcePath(path, gQuartersTag, gNamesFormatTag, gNamesWideTag, status), status);
+    initField(&fShortQuarters, fShortQuartersCount, calendarSink,
+              buildResourcePath(path, gQuartersTag, gNamesFormatTag, gNamesAbbrTag, status), status);
+
+    initField(&fStandaloneQuarters, fStandaloneQuartersCount, calendarSink,
+              buildResourcePath(path, gQuartersTag, gNamesStandaloneTag, gNamesWideTag, status), status);
     if(status == U_MISSING_RESOURCE_ERROR) {
         status = U_ZERO_ERROR;
-        initField(&fStandaloneQuarters, fStandaloneQuartersCount, calData.getByKey2(gQuartersTag, gNamesWideTag, status), status);
+        assignArray(fStandaloneQuarters, fStandaloneQuartersCount, fQuarters, fQuartersCount);
     }
-
-    initField(&fStandaloneShortQuarters, fStandaloneShortQuartersCount, calData.getByKey3(gQuartersTag, gNamesStandaloneTag, gNamesAbbrTag, status), status);
+    initField(&fStandaloneShortQuarters, fStandaloneShortQuartersCount, calendarSink,
+              buildResourcePath(path, gQuartersTag, gNamesStandaloneTag, gNamesAbbrTag, status), status);
     if(status == U_MISSING_RESOURCE_ERROR) {
         status = U_ZERO_ERROR;
-        initField(&fStandaloneShortQuarters, fStandaloneShortQuartersCount, calData.getByKey2(gQuartersTag, gNamesAbbrTag, status), status);
+        assignArray(fStandaloneShortQuarters, fStandaloneShortQuartersCount, fShortQuarters, fShortQuartersCount);
     }
 
+    // ICU 3.8 or later version no longer uses localized date-time pattern characters by default (ticket#5597)
+    /*
     // fastCopyFrom()/setTo() - see assignArray comments
     resStr = ures_getStringByKey(fResourceBundle, gLocalPatternCharsTag, &len, &status);
     fLocalPatternChars.setTo(TRUE, resStr, len);
@@ -1262,766 +2373,121 @@ DateFormatSymbols::initializeData(const Locale& locale, const char *type, UError
     if (len < PATTERN_CHARS_LEN) {
         fLocalPatternChars.append(UnicodeString(TRUE, &gPatternChars[len], PATTERN_CHARS_LEN-len));
     }
+    */
+    fLocalPatternChars.setTo(TRUE, gPatternChars, PATTERN_CHARS_LEN);
 
+    // Format wide weekdays -> fWeekdays
     // {sfb} fixed to handle 1-based weekdays
-    weekdaysData = calData.getByKey2(gDayNamesTag, gNamesWideTag, status);
-    fWeekdaysCount = ures_getSize(weekdaysData);
-    fWeekdays = new UnicodeString[fWeekdaysCount+1];
-    /* pin the blame on system. If we cannot get a chunk of memory .. the system is dying!*/
-    if (fWeekdays == NULL) {
-        status = U_MEMORY_ALLOCATION_ERROR;
-        goto cleanup;
-    }
-    // leave fWeekdays[0] empty
-    for(i = 0; i<fWeekdaysCount; i++) {
-        resStr = ures_getStringByIndex(weekdaysData, i, &len, &status);
-        // setTo() - see assignArray comments
-        fWeekdays[i+1].setTo(TRUE, resStr, len);
-    }
-    fWeekdaysCount++;
+    initField(&fWeekdays, fWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesFormatTag, gNamesWideTag, status), 1, status);
 
-    lsweekdaysData = calData.getByKey2(gDayNamesTag, gNamesAbbrTag, status);
-    fShortWeekdaysCount = ures_getSize(lsweekdaysData);
-    fShortWeekdays = new UnicodeString[fShortWeekdaysCount+1];
-    /* test for NULL */
-    if (fShortWeekdays == 0) {
-        status = U_MEMORY_ALLOCATION_ERROR;
-        goto cleanup;
-    }
-    // leave fShortWeekdays[0] empty
-    for(i = 0; i<fShortWeekdaysCount; i++) {
-        resStr = ures_getStringByIndex(lsweekdaysData, i, &len, &status);
-        // setTo() - see assignArray comments
-        fShortWeekdays[i+1].setTo(TRUE, resStr, len);
-    }
-    fShortWeekdaysCount++;
+    // Format abbreviated weekdays -> fShortWeekdays
+    initField(&fShortWeekdays, fShortWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesFormatTag, gNamesAbbrTag, status), 1, status);
 
-    narrowWeekdaysData = calData.getByKey2(gDayNamesTag, gNamesNarrowTag, status);
-    if(status == U_MISSING_RESOURCE_ERROR) {
+    // Format short weekdays -> fShorterWeekdays (fall back to abbreviated)
+    initField(&fShorterWeekdays, fShorterWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesFormatTag, gNamesShortTag, status), 1, status);
+    if (status == U_MISSING_RESOURCE_ERROR) {
         status = U_ZERO_ERROR;
-        narrowWeekdaysData = calData.getByKey3(gDayNamesTag, gNamesStandaloneTag, gNamesNarrowTag, status);
-    }
-    if ( status == U_MISSING_RESOURCE_ERROR ) {
-       status = U_ZERO_ERROR;
-       narrowWeekdaysData = calData.getByKey2(gDayNamesTag, gNamesAbbrTag, status);
-    }
-    fNarrowWeekdaysCount = ures_getSize(narrowWeekdaysData);
-    fNarrowWeekdays = new UnicodeString[fNarrowWeekdaysCount+1];
-    /* test for NULL */
-    if (fNarrowWeekdays == 0) {
-        status = U_MEMORY_ALLOCATION_ERROR;
-        goto cleanup;
-    }
-    // leave fNarrowWeekdays[0] empty
-    for(i = 0; i<fNarrowWeekdaysCount; i++) {
-        resStr = ures_getStringByIndex(narrowWeekdaysData, i, &len, &status);
-        // setTo() - see assignArray comments
-        fNarrowWeekdays[i+1].setTo(TRUE, resStr, len);
-    }
-    fNarrowWeekdaysCount++;
-
-    standaloneWeekdaysData = calData.getByKey3(gDayNamesTag, gNamesStandaloneTag, gNamesWideTag, status);
-    if ( status == U_MISSING_RESOURCE_ERROR ) {
-       status = U_ZERO_ERROR;
-       standaloneWeekdaysData = calData.getByKey2(gDayNamesTag, gNamesWideTag, status);
-    }
-    fStandaloneWeekdaysCount = ures_getSize(standaloneWeekdaysData);
-    fStandaloneWeekdays = new UnicodeString[fStandaloneWeekdaysCount+1];
-    /* test for NULL */
-    if (fStandaloneWeekdays == 0) {
-        status = U_MEMORY_ALLOCATION_ERROR;
-        goto cleanup;
+        assignArray(fShorterWeekdays, fShorterWeekdaysCount, fShortWeekdays, fShortWeekdaysCount);
     }
-    // leave fStandaloneWeekdays[0] empty
-    for(i = 0; i<fStandaloneWeekdaysCount; i++) {
-        resStr = ures_getStringByIndex(standaloneWeekdaysData, i, &len, &status);
-        // setTo() - see assignArray comments
-        fStandaloneWeekdays[i+1].setTo(TRUE, resStr, len);
-    }
-    fStandaloneWeekdaysCount++;
 
-    standaloneShortWeekdaysData = calData.getByKey3(gDayNamesTag, gNamesStandaloneTag, gNamesAbbrTag, status);
-    if ( status == U_MISSING_RESOURCE_ERROR ) {
-       status = U_ZERO_ERROR;
-       standaloneShortWeekdaysData = calData.getByKey2(gDayNamesTag, gNamesAbbrTag, status);
-    }
-    fStandaloneShortWeekdaysCount = ures_getSize(standaloneShortWeekdaysData);
-    fStandaloneShortWeekdays = new UnicodeString[fStandaloneShortWeekdaysCount+1];
-    /* test for NULL */
-    if (fStandaloneShortWeekdays == 0) {
-        status = U_MEMORY_ALLOCATION_ERROR;
-        goto cleanup;
-    }
-    // leave fStandaloneShortWeekdays[0] empty
-    for(i = 0; i<fStandaloneShortWeekdaysCount; i++) {
-        resStr = ures_getStringByIndex(standaloneShortWeekdaysData, i, &len, &status);
-        // setTo() - see assignArray comments
-        fStandaloneShortWeekdays[i+1].setTo(TRUE, resStr, len);
-    }
-    fStandaloneShortWeekdaysCount++;
-
-    standaloneNarrowWeekdaysData = calData.getByKey3(gDayNamesTag, gNamesStandaloneTag, gNamesNarrowTag, status);
-    if ( status == U_MISSING_RESOURCE_ERROR ) {
-       status = U_ZERO_ERROR;
-       standaloneNarrowWeekdaysData = calData.getByKey2(gDayNamesTag, gNamesNarrowTag, status);
-       if ( status == U_MISSING_RESOURCE_ERROR ) {
-          status = U_ZERO_ERROR;
-          standaloneNarrowWeekdaysData = calData.getByKey2(gDayNamesTag, gNamesAbbrTag, status);
-       }
-    }
-    fStandaloneNarrowWeekdaysCount = ures_getSize(standaloneNarrowWeekdaysData);
-    fStandaloneNarrowWeekdays = new UnicodeString[fStandaloneNarrowWeekdaysCount+1];
-    /* test for NULL */
-    if (fStandaloneNarrowWeekdays == 0) {
-        status = U_MEMORY_ALLOCATION_ERROR;
-        goto cleanup;
-    }
-    // leave fStandaloneNarrowWeekdays[0] empty
-    for(i = 0; i<fStandaloneNarrowWeekdaysCount; i++) {
-        resStr = ures_getStringByIndex(standaloneNarrowWeekdaysData, i, &len, &status);
-        // setTo() - see assignArray comments
-        fStandaloneNarrowWeekdays[i+1].setTo(TRUE, resStr, len);
-    }
-    fStandaloneNarrowWeekdaysCount++;
-
-cleanup:
-    ures_close(eras);
-    ures_close(eraNames);
-}
-
-/**
- * Package private: used by SimpleDateFormat
- * Gets the index for the given time zone ID to obtain the timezone
- * strings for formatting. The time zone ID is just for programmatic
- * lookup. NOT LOCALIZED!!!
- * @param ID the given time zone ID.
- * @return the index of the given time zone ID.  Returns -1 if
- * the given time zone ID can't be located in the DateFormatSymbols object.
- * @see java.util.SimpleTimeZone
- */
-int32_t DateFormatSymbols::getZoneIndex(const UnicodeString& ID) const
-{
-    int32_t result = _getZoneIndex(ID);
-    if (result >= 0) {
-        return result;
+    // Stand-alone wide weekdays -> fStandaloneWeekdays
+    initField(&fStandaloneWeekdays, fStandaloneWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesStandaloneTag, gNamesWideTag, status), 1, status);
+    if (status == U_MISSING_RESOURCE_ERROR) { /* If standalone/wide is not available, use format/wide */
+        status = U_ZERO_ERROR;
+        assignArray(fStandaloneWeekdays, fStandaloneWeekdaysCount, fWeekdays, fWeekdaysCount);
     }
 
-    // Do a search through the equivalency group for the given ID
-    int32_t n = TimeZone::countEquivalentIDs(ID);
-    if (n > 1) {
-        int32_t i;
-        for (i=0; i<n; ++i) {
-            UnicodeString equivID = TimeZone::getEquivalentID(ID, i);
-            if (equivID != ID) {
-                int32_t equivResult = _getZoneIndex(equivID);
-                if (equivResult >= 0) {
-                    return equivResult;
-                }
-            }
-        }
+    // Stand-alone abbreviated weekdays -> fStandaloneShortWeekdays
+    initField(&fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesStandaloneTag, gNamesAbbrTag, status), 1, status);
+    if (status == U_MISSING_RESOURCE_ERROR) { /* If standalone/abbreviated is not available, use format/abbreviated */
+        status = U_ZERO_ERROR;
+        assignArray(fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount, fShortWeekdays, fShortWeekdaysCount);
     }
 
-    return -1;
-}
+    // Stand-alone short weekdays -> fStandaloneShorterWeekdays (fall back to format abbreviated)
+    initField(&fStandaloneShorterWeekdays, fStandaloneShorterWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesStandaloneTag, gNamesShortTag, status), 1, status);
+    if (status == U_MISSING_RESOURCE_ERROR) { /* If standalone/short is not available, use format/short */
+        status = U_ZERO_ERROR;
+        assignArray(fStandaloneShorterWeekdays, fStandaloneShorterWeekdaysCount, fShorterWeekdays, fShorterWeekdaysCount);
+    }
+
+    // Format narrow weekdays -> fNarrowWeekdays
+    UErrorCode narrowWeeksEC = status;
+    initField(&fNarrowWeekdays, fNarrowWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesFormatTag, gNamesNarrowTag, status), 1, narrowWeeksEC);
+    // Stand-alone narrow weekdays -> fStandaloneNarrowWeekdays
+    UErrorCode standaloneNarrowWeeksEC = status;
+    initField(&fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, calendarSink,
+              buildResourcePath(path, gDayNamesTag, gNamesStandaloneTag, gNamesNarrowTag, status), 1, standaloneNarrowWeeksEC);
+
+    if (narrowWeeksEC == U_MISSING_RESOURCE_ERROR && standaloneNarrowWeeksEC != U_MISSING_RESOURCE_ERROR) {
+        // If format/narrow not available, use standalone/narrow
+        assignArray(fNarrowWeekdays, fNarrowWeekdaysCount, fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount);
+    } else if (narrowWeeksEC != U_MISSING_RESOURCE_ERROR && standaloneNarrowWeeksEC == U_MISSING_RESOURCE_ERROR) {
+        // If standalone/narrow not available, use format/narrow
+        assignArray(fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, fNarrowWeekdays, fNarrowWeekdaysCount);
+    } else if (narrowWeeksEC == U_MISSING_RESOURCE_ERROR && standaloneNarrowWeeksEC == U_MISSING_RESOURCE_ERROR ) {
+        // If neither is available, use format/abbreviated
+        assignArray(fNarrowWeekdays, fNarrowWeekdaysCount, fShortWeekdays, fShortWeekdaysCount);
+        assignArray(fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, fShortWeekdays, fShortWeekdaysCount);
+    }
+
+    // Last resort fallback in case previous data wasn't loaded
+    if (U_FAILURE(status))
+    {
+        if (useLastResortData)
+        {
+            // Handle the case in which there is no resource data present.
+            // We don't have to generate usable patterns in this situation;
+            // we just need to produce something that will be semi-intelligible
+            // in most locales.
 
-/**
- * Lookup the given ID.  Do NOT do an equivalency search.
- */
-int32_t DateFormatSymbols::_getZoneIndex(const UnicodeString& ID) const
-{
-    for(int32_t index = 0; index < fZoneStringsRowCount; index++) {
-        if (0 == ID.caseCompare(fZoneStrings[index][0], 0)) {
-            return index;
+            status = U_USING_FALLBACK_WARNING;
+            //TODO(fabalbon): make sure we are storing las resort data for all fields in here.
+            initField(&fEras, fErasCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
+            initField(&fEraNames, fEraNamesCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
+            initField(&fNarrowEras, fNarrowErasCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
+            initField(&fMonths, fMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
+            initField(&fShortMonths, fShortMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fNarrowMonths, fNarrowMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fStandaloneMonths, fStandaloneMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
+            initField(&fStandaloneShortMonths, fStandaloneShortMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fWeekdays, fWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fShortWeekdays, fShortWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fShorterWeekdays, fShorterWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fNarrowWeekdays, fNarrowWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneWeekdays, fStandaloneWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneShorterWeekdays, fStandaloneShorterWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fAmPms, fAmPmsCount, (const UChar *)gLastResortAmPmMarkers, kAmPmNum, kAmPmLen, status);
+            initField(&fNarrowAmPms, fNarrowAmPmsCount, (const UChar *)gLastResortAmPmMarkers, kAmPmNum, kAmPmLen, status);
+            initField(&fQuarters, fQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fShortQuarters, fShortQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fStandaloneQuarters, fStandaloneQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fStandaloneShortQuarters, fStandaloneShortQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            fLocalPatternChars.setTo(TRUE, gPatternChars, PATTERN_CHARS_LEN);
         }
     }
 
-    return -1;
+    // Close resources
+    ures_close(cb);
+    ures_close(rb);
 }
 
-Locale 
+Locale
 DateFormatSymbols::getLocale(ULocDataLocaleType type, UErrorCode& status) const {
     U_LOCALE_BASED(locBased, *this);
     return locBased.getLocale(type, status);
 }
 
-class TimeZoneKeysEnumeration : public StringEnumeration {
-private:
-    UnicodeString* strings;
-    int32_t length;
-    int32_t current;
-    int32_t capacity;
-    TimeZoneKeysEnumeration(UnicodeString* oldStrs, int32_t count){
-        strings = newUnicodeStringArray(count);
-        if(strings==NULL){
-            return;
-        }
-        capacity = count;
-        current = 0;
-        for(length = 0; length<capacity; length++){
-            strings[length].setTo(oldStrs[length]);
-        }
-    }    
-public:
-    static UClassID U_EXPORT2 getStaticClassID(void);
-    virtual UClassID getDynamicClassID(void) const;
-
-    TimeZoneKeysEnumeration(int32_t count, UErrorCode status){
-        strings = newUnicodeStringArray(count);
-        if(strings == NULL){
-            status = U_MEMORY_ALLOCATION_ERROR;
-        }
-        length = 0; 
-        current = 0;
-        capacity = count;
-    }
-
-    void put(const UnicodeString& str, UErrorCode& status){
-        if(length < capacity){
-            strings[length++].setTo(str);
-        }else{
-            status = U_INDEX_OUTOFBOUNDS_ERROR;
-        }
-    }
-    virtual ~TimeZoneKeysEnumeration() {
-        delete[] strings;
-    }
-
-    virtual StringEnumeration * clone() const
-    {
-        return new TimeZoneKeysEnumeration(strings, length);
-    }
-
-    virtual int32_t count(UErrorCode &/*status*/) const {
-        return length;
-    }
-    virtual const UChar* unext(int32_t *resultLength, UErrorCode& /*status*/){
-        if(current < length){
-            const UChar* ret = strings[current].getBuffer();
-            *resultLength = strings[current].length();
-            current++;
-            return ret;
-        }
-        return NULL;
-    }
-
-    virtual const UnicodeString* snext(UErrorCode& status) {
-        if(U_FAILURE(status)){
-            return NULL;
-        }
-        if(current < length){
-            return &strings[current++];
-        }
-        return NULL;
-    }
-    /* this method is for thread safe iteration */
-    const UnicodeString* snext(int32_t& pos, UErrorCode& status)const {
-        if(U_FAILURE(status)){
-            return NULL;
-        }
-        if(pos < length){
-            return &strings[pos++];
-        }
-        return NULL;
-    }
-
-    virtual void reset(UErrorCode& /*status*/) {
-        current = 0;
-
-    }
-private:
-    UBool equals(const StringEnumeration& other) const{
-        if (other.getDynamicClassID() != TimeZoneKeysEnumeration::getStaticClassID()) {
-            return FALSE;
-        }
-        TimeZoneKeysEnumeration& enum2 =  (TimeZoneKeysEnumeration&)(other);
-        UErrorCode status = U_ZERO_ERROR;
-
-        int32_t count1 = count(status);
-        int32_t count2 = other.count(status);
-        if(count1 != count2){
-            return FALSE;
-        }
-        int32_t pos1 = 0; 
-        int32_t pos2 = 0;
-        const UnicodeString* str1 = NULL;
-        const UnicodeString* str2 = NULL;
-
-        while((str1 = snext(pos1, status))!=NULL){ 
-            str2 = enum2.snext(pos2, status);
-            if(U_FAILURE(status)){
-                return FALSE;
-            }
-            if(*str1 != *str2){
-                // bail out at the first failure
-                return FALSE;
-            }
-            
-        }
-        // if we reached here that means that the enumerations are equal
-        return TRUE;
-    }
-public:
-    virtual UBool operator==(const StringEnumeration& that)const{
-        return ((this == &that) ||
-            (getDynamicClassID() == that.getDynamicClassID() &&
-            StringEnumeration::operator==(that) &&
-            equals(that)));
-    }
-};
-
-UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeZoneKeysEnumeration)
-
-void
-DateFormatSymbols::initZoneStringsArray(UErrorCode& status){
-    if(fZoneStringsHash == NULL){
-        initZoneStrings(status);
-    }
-    if(U_FAILURE(status)){
-        return;
-    }
-    fZoneStringsRowCount = fZoneIDEnumeration->count(status);
-    fZoneStringsColCount = 8;
-    fZoneStrings = (UnicodeString **)uprv_malloc(fZoneStringsRowCount * sizeof(UnicodeString *));
-    /* if we can't get a chunk of heap then the system is going down. Pin the blame on system*/
-    if (fZoneStrings == NULL) {
-        status = U_MEMORY_ALLOCATION_ERROR;
-        return;
-    }
-    const UnicodeString *zid = NULL;
-    TimeZoneKeysEnumeration *keys = (TimeZoneKeysEnumeration*) fZoneIDEnumeration;
-    int32_t pos = 0;
-    int32_t i = 0;
-    while((zid=keys->snext(pos,status))!=NULL){
-        *(fZoneStrings+i) = newUnicodeStringArray(fZoneStringsColCount);
-        /* test for NULL */
-        if ((*(fZoneStrings+i)) == 0) {
-            status = U_MEMORY_ALLOCATION_ERROR;
-            return;
-        }
-        UnicodeString* strings = (UnicodeString*)fZoneStringsHash->get(*zid);
-        fZoneStrings[i][0].setTo(*zid);
-        fZoneStrings[i][1].setTo(strings[TIMEZONE_LONG_STANDARD]);
-        fZoneStrings[i][2].setTo(strings[TIMEZONE_SHORT_STANDARD]);
-        fZoneStrings[i][3].setTo(strings[TIMEZONE_LONG_DAYLIGHT]);
-        fZoneStrings[i][4].setTo(strings[TIMEZONE_SHORT_DAYLIGHT]);
-        fZoneStrings[i][5].setTo(strings[TIMEZONE_EXEMPLAR_CITY]);
-        if(fZoneStrings[i][5].length()==0){
-            fZoneStrings[i][5].setTo(strings[TIMEZONE_LONG_GENERIC]);
-        }else{
-            fZoneStrings[i][6].setTo(strings[TIMEZONE_LONG_GENERIC]);
-        }
-        if(fZoneStrings[i][6].length()==0){
-            fZoneStrings[i][6].setTo(strings[TIMEZONE_LONG_GENERIC]);
-        }else{
-            fZoneStrings[i][7].setTo(strings[TIMEZONE_LONG_GENERIC]);
-        }
-        i++;
-    }
-}
-
-U_CDECL_BEGIN
-static UBool U_CALLCONV 
-compareTZHashValues(const UHashTok val1, const UHashTok val2){
-
-    const UnicodeString* array1 = (UnicodeString*) val1.pointer;
-    const UnicodeString* array2 = (UnicodeString*) val2.pointer;
-    if(array1==array2){
-        return TRUE;
-    }
-    if(array1==NULL || array2==NULL){
-        return FALSE;
-    }
-    for(int32_t j=0; j< UTZ_MAX_DISPLAY_STRINGS_LENGTH; j++){
-        if(array1[j] != array2[j]){
-            return FALSE;
-        }
-    }
-    return TRUE;
-}
-U_CDECL_END
-
-void
-DateFormatSymbols::initZoneStrings(UErrorCode &status){
-    if(U_FAILURE(status)){
-        return;
-    }  
-
-    if(fZoneStringsHash != NULL){
-        return;
-    }
-    int32_t i;
-    
-    fZoneStringsHash = new Hashtable(uhash_compareUnicodeString, compareTZHashValues, status);
-    if(fZoneStringsHash==NULL){
-        status = U_MEMORY_ALLOCATION_ERROR;
-        return;
-    }
-    fZoneStringsHash->setValueDeleter(deleteUnicodeStringArray);
-
-    if(fResourceBundle != NULL){
-        UnicodeString solidus = UNICODE_STRING_SIMPLE("/");
-        UnicodeString colon = UNICODE_STRING_SIMPLE(":");
-        UResourceBundle zoneArray,zoneItem;
-        ures_initStackObject(&zoneItem);
-        ures_initStackObject(&zoneArray);
-        for(const UResourceBundle* rb = fResourceBundle; rb!=NULL; rb=ures_getParentBundle(rb)){
-            ures_getByKey(rb, gZoneStringsTag, &zoneArray, &status);
-            if(U_FAILURE(status)){
-                break;
-            }
-            while(ures_hasNext(&zoneArray)){
-                UErrorCode tempStatus = U_ZERO_ERROR;
-                UnicodeString* array = newUnicodeStringArray(UTZ_MAX_DISPLAY_STRINGS_LENGTH);
-                ures_getNextResource(&zoneArray, &zoneItem, &status);
-                UnicodeString key(ures_getKey(&zoneItem), -1, US_INV);
-                key.findAndReplace(colon, solidus);
-                int32_t len = 0;
-                //fetch the strings with fine grained fallback
-                const UChar* str = ures_getStringByKeyWithFallback(&zoneItem,UTZ_SHORT_STANDARD, &len, &tempStatus);
-                if(U_SUCCESS(tempStatus)){
-                    array[TIMEZONE_SHORT_STANDARD].setTo(TRUE, str, len);
-                }else{
-                    tempStatus = U_ZERO_ERROR;
-                }
-                str = ures_getStringByKeyWithFallback(&zoneItem,UTZ_SHORT_GENERIC, &len, &tempStatus);
-                if(U_SUCCESS(tempStatus)){
-                    array[TIMEZONE_SHORT_GENERIC].setTo(TRUE, str, len);
-                }else{
-                    tempStatus = U_ZERO_ERROR;
-                }                
-                str = ures_getStringByKeyWithFallback(&zoneItem,UTZ_SHORT_DAYLIGHT, &len, &tempStatus);
-                if(U_SUCCESS(tempStatus)){
-                    array[TIMEZONE_SHORT_DAYLIGHT].setTo(TRUE, str, len);
-                }else{
-                    tempStatus = U_ZERO_ERROR;
-                }
-                str = ures_getStringByKeyWithFallback(&zoneItem,UTZ_LONG_STANDARD, &len, &tempStatus);
-                if(U_SUCCESS(tempStatus)){
-                    array[TIMEZONE_LONG_STANDARD].setTo(TRUE, str, len);
-                }else{
-                    tempStatus = U_ZERO_ERROR;
-                }
-                str = ures_getStringByKeyWithFallback(&zoneItem,UTZ_LONG_GENERIC, &len, &tempStatus);
-                if(U_SUCCESS(tempStatus)){
-                    array[TIMEZONE_LONG_GENERIC].setTo(TRUE, str, len);
-                }else{
-                    tempStatus = U_ZERO_ERROR;
-                }                
-                str = ures_getStringByKeyWithFallback(&zoneItem,UTZ_LONG_DAYLIGHT, &len, &tempStatus);
-                if(U_SUCCESS(tempStatus)){
-                    array[TIMEZONE_LONG_DAYLIGHT].setTo(TRUE, str, len);
-                }else{
-                    tempStatus = U_ZERO_ERROR;
-                }
-                str = ures_getStringByKeyWithFallback(&zoneItem,UTZ_EXEMPLAR_CITY, &len, &tempStatus);
-                if(U_SUCCESS(tempStatus)){
-                    array[TIMEZONE_EXEMPLAR_CITY].setTo(TRUE, str, len);
-                }else{
-                    tempStatus = U_ZERO_ERROR;
-                }
-                // store the strings in hash
-                fZoneStringsHash->put(key, array, status);
-            }
-            ures_close(&zoneItem);
-            ures_close(&zoneArray);
-        }
-        int32_t length = fZoneStringsHash->count();
-        TimeZoneKeysEnumeration* keysEnum = new TimeZoneKeysEnumeration(length, status);
-        fZoneIDEnumeration = keysEnum;
-        if(fZoneIDEnumeration==NULL){
-            delete fZoneStringsHash;
-            fZoneStringsHash = NULL;
-            status = U_MEMORY_ALLOCATION_ERROR;
-            return;
-        }
-        int32_t pos=-1;
-        const UnicodeString* key; 
-        const UHashElement* elem = NULL;
-        while((elem = fZoneStringsHash->nextElement(pos))!= NULL){  
-            const UHashTok keyTok = elem->key;
-            key = (const UnicodeString*)keyTok.pointer;
-            keysEnum->put(*key, status);
-        }
-    }else{
-        //last resort strings
-        UnicodeString* array = newUnicodeStringArray(UTZ_MAX_DISPLAY_STRINGS_LENGTH);
-        if(array==NULL){
-            delete fZoneStringsHash;
-            status = U_MEMORY_ALLOCATION_ERROR;
-            return;
-        }
-        int32_t length = ARRAY_LENGTH(gLastResortZoneStrings);
-        UnicodeString key(gLastResortZoneStrings[0]);
-        TimeZoneKeysEnumeration* keysEnum = new TimeZoneKeysEnumeration(length, status);
-        fZoneIDEnumeration = keysEnum;
-        if(fZoneIDEnumeration==NULL){
-            delete fZoneStringsHash;
-            delete[] array;
-            fZoneStringsHash = NULL;
-            status = U_MEMORY_ALLOCATION_ERROR;
-            return;
-        }
-        keysEnum->put(key, status);
-        int32_t j=1;
-        for(i=0; i< length; ){
-            array[i++].setTo(gLastResortZoneStrings[j++]);
-        }
-        fZoneStringsHash->put(key, array, status);
-    }
-}
-void 
-DateFormatSymbols::initZoneStrings(const UnicodeString** strings, int32_t rowCount, int32_t columnCount, UErrorCode& status){
-    if(strings==NULL || rowCount<0 || columnCount<0){
-        status = U_ILLEGAL_ARGUMENT_ERROR;
-        return;
-    }
-    TimeZoneKeysEnumeration* keysEnum = new TimeZoneKeysEnumeration(rowCount, status);
-    fZoneIDEnumeration = keysEnum;
-    if(U_FAILURE(status)){
-        return;
-    }
-    if(fZoneIDEnumeration==NULL){
-        status = U_MEMORY_ALLOCATION_ERROR;
-        return;
-    }
-    fZoneStringsHash = new Hashtable(uhash_compareUnicodeString, compareTZHashValues, status);
-    if(U_FAILURE(status)){
-        return;
-    }
-    if(fZoneStringsHash==NULL){
-        status = U_MEMORY_ALLOCATION_ERROR;
-        return;
-    }
-    fZoneStringsHash->setValueDeleter(deleteUnicodeStringArray);
-    for (int32_t row=0; row<rowCount; ++row){
-        // the first string in the array is the key.
-        UnicodeString key = strings[row][0];
-        keysEnum->put(key, status);
-        UnicodeString* array = newUnicodeStringArray(UTZ_MAX_DISPLAY_STRINGS_LENGTH);
-        if(array==NULL){
-            status = U_MEMORY_ALLOCATION_ERROR;
-            return;
-        }
-        for (int32_t col=1; col<columnCount; ++col) {
-            // fastCopyFrom() - see assignArray comments
-            switch (col){
-                case 1:
-                    array[TIMEZONE_LONG_STANDARD].setTo(strings[row][col]);
-                    break;
-                case 2:
-                    array[TIMEZONE_SHORT_STANDARD].setTo(strings[row][col]);
-                    break;
-                case 3:
-                    array[TIMEZONE_LONG_DAYLIGHT].setTo(strings[row][col]);
-                    break;
-                case 4:
-                     array[TIMEZONE_LONG_DAYLIGHT].setTo(strings[row][col]);
-                     break;
-                case 5:
-                    if(fZoneStringsColCount==6 || fZoneStringsColCount==8){
-                        array[TIMEZONE_EXEMPLAR_CITY].setTo(strings[row][col]);
-                    }else{
-                        array[TIMEZONE_LONG_GENERIC].setTo(strings[row][col]);
-                    }
-                    break;
-                case 6:
-                    if(fZoneStringsColCount==8){
-                        array[TIMEZONE_LONG_GENERIC].setTo(strings[row][col]);
-                    }else{
-                        array[TIMEZONE_SHORT_GENERIC].setTo(strings[row][col]);
-                    }
-                    break; 
-                case 7:
-                    array[TIMEZONE_SHORT_GENERIC].setTo(strings[row][col]);
-                    break;
-                default:
-                    status = U_ILLEGAL_ARGUMENT_ERROR;
-            }
-            // populate the hash table
-            fZoneStringsHash->put(strings[row][0], array, status);
-        }
-    }
-
-}
-
-UnicodeString&
-DateFormatSymbols::getZoneString(const UnicodeString &zid, const TimeZoneTranslationType type, 
-                                 UnicodeString &result, UErrorCode &status){
-
-    if(fZoneStringsHash == NULL){
-        //lazy initialization
-        initZoneStrings(status);
-    }
-    if(U_FAILURE(status)){
-        return result;
-    }
-    UnicodeString* stringsArray = (UnicodeString*)fZoneStringsHash->get(zid);
-    if(stringsArray != NULL){
-        result.setTo(stringsArray[type],0);
-    }
-
-    return result;
-}
-
-StringEnumeration* 
-DateFormatSymbols::createZoneStringIDs(UErrorCode &status){
-    if(U_FAILURE(status)){
-        return NULL;
-    }
-    if(fZoneStringsHash == NULL){    
-        //lazy initialization
-        initZoneStrings(status);
-    }
-    return fZoneIDEnumeration->clone();
-}
-
-/**
- * Sets timezone strings.
- * @draft ICU 3.6
- */
-void 
-DateFormatSymbols::setZoneString(const UnicodeString &zid, const TimeZoneTranslationType type,
-                                 const UnicodeString &value, UErrorCode &status){
-    if(fZoneStringsHash == NULL){
-        //lazy initialization
-        initZoneStrings(status);
-    }
-    if(U_FAILURE(status)){
-        return;
-    }
-    UnicodeString* stringsArray = (UnicodeString*)fZoneStringsHash->get(zid);
-    if(stringsArray != NULL){
-        stringsArray[type].setTo(value);
-    }else{
-        stringsArray = newUnicodeStringArray(UTZ_MAX_DISPLAY_STRINGS_LENGTH); 
-        if(stringsArray==NULL){
-            status = U_MEMORY_ALLOCATION_ERROR;
-            return;
-        }
-        stringsArray[type].setTo(value);
-        fZoneStringsHash->put(zid, stringsArray, status);
-        TimeZoneKeysEnumeration* keys = (TimeZoneKeysEnumeration*) fZoneIDEnumeration;
-        keys->put(zid, status);
-    }
-}
-
-Hashtable* 
-DateFormatSymbols::createZoneStringsHash(const Hashtable* otherHash){
-    UErrorCode status = U_ZERO_ERROR;
-    Hashtable* hash = new Hashtable(uhash_compareUnicodeString, compareTZHashValues, status);
-    if(hash==NULL){
-        return NULL;
-    }
-    if(U_FAILURE(status)){
-        return NULL;
-    }
-    hash->setValueDeleter(deleteUnicodeStringArray);
-    int32_t pos = -1;
-    const UHashElement* elem = NULL;
-    // walk through the hash table and create a deep clone 
-    while((elem = otherHash->nextElement(pos))!= NULL){
-        const UHashTok otherKeyTok = elem->key;
-        const UHashTok otherValueTok = elem->value;
-        UnicodeString* otherKey = (UnicodeString*)otherKeyTok.pointer;
-        UnicodeString* otherArray = (UnicodeString*)otherValueTok.pointer;
-        UnicodeString* array = newUnicodeStringArray(UTZ_MAX_DISPLAY_STRINGS_LENGTH);
-        if(array==NULL){
-            return NULL;
-        }
-        UnicodeString key(*otherKey);
-        for(int32_t i=0; i<UTZ_MAX_DISPLAY_STRINGS_LENGTH; i++){
-            array[i].setTo(otherArray[i]);
-        }
-        hash->put(key, array, status);
-        if(U_FAILURE(status)){
-            delete[] array;
-            return NULL;
-        }
-    } 
-    return hash;
-}
-
-
-UnicodeString&
-DateFormatSymbols::getZoneID(const UnicodeString& zid, UnicodeString& result, UErrorCode& status){
-    if(fZoneStringsHash == NULL){
-        initZoneStrings(status); 
-    }
-    if(U_FAILURE(status)){
-        return result;
-    }
-    UnicodeString* strings = (UnicodeString*)fZoneStringsHash->get(zid);
-    if (strings != NULL) {
-        return result.setTo(zid,0);
-    }
-
-    // Do a search through the equivalency group for the given ID
-    int32_t n = TimeZone::countEquivalentIDs(zid);
-    if (n > 1) {
-        int32_t i;
-        for (i=0; i<n; ++i) {
-            UnicodeString equivID = TimeZone::getEquivalentID(zid, i);
-            if (equivID != zid) {
-                strings = (UnicodeString*)fZoneStringsHash->get(equivID);
-                if (strings != NULL) {
-                    return result.setTo(equivID,0);
-                }
-            }
-        }
-    }else{
-        result.setTo(zid);
-    }
-    return result;
-}
-
-void
-DateFormatSymbols::getZoneType(const UnicodeString& zid, const UnicodeString& text, int32_t start, 
-                               TimeZoneTranslationType& type, UnicodeString& value, UErrorCode& status){
-    if(fZoneStringsHash == NULL){
-        initZoneStrings(status);
-    }
-    if(U_FAILURE(status)){
-        return;
-    }
-    type = TIMEZONE_COUNT;
-    UnicodeString* strings = (UnicodeString*)fZoneStringsHash->get(zid);
-    if(strings != NULL){
-        for(int32_t j=0; j<UTZ_MAX_DISPLAY_STRINGS_LENGTH; j++){
-            if(strings[j].length() >0 && text.caseCompare(start, strings[j].length(), strings[j], 0)==0){
-                type = (TimeZoneTranslationType)j;
-                value.setTo(strings[j]);
-                return;
-            }
-        }
-    }
-}
-void
-DateFormatSymbols::findZoneIDTypeValue( UnicodeString& zid, const UnicodeString& text, int32_t start, 
-                                        TimeZoneTranslationType& type, UnicodeString& value,
-                                        UErrorCode& status){
-    if(fZoneStringsHash == NULL){
-        initZoneStrings(status);
-    }
-    if(U_FAILURE(status)){
-        return;
-    }
-    const UnicodeString* myKey = NULL;
-    int32_t pos = 0;
-    TimeZoneKeysEnumeration *keys = (TimeZoneKeysEnumeration*)fZoneIDEnumeration;
-    while( (myKey=keys->snext(pos, status))!= NULL){
-        UnicodeString* strings = (UnicodeString*)fZoneStringsHash->get(*myKey);
-        if(strings != NULL){
-            for(int32_t j=0; j<UTZ_MAX_DISPLAY_STRINGS_LENGTH; j++){
-                if(strings[j].length()>0 && text.caseCompare(start, strings[j].length(), strings[j], 0)==0){
-                    type = (TimeZoneTranslationType)j;
-                    value.setTo(strings[j]);
-                    zid.setTo(*myKey);
-                    return;
-                }
-            }
-        }
-    }
-}
 U_NAMESPACE_END
 
 #endif /* #if !UCONFIG_NO_FORMATTING */