Index: source/i18n/ucal.cpp |
diff --git a/source/i18n/ucal.cpp b/source/i18n/ucal.cpp |
index dbbd711a3e39252cb6d4b2010e76834e0525d7aa..ccca97bba86fb99e1d73bfdeb4bf78bc7a6ed7ac 100644 |
--- a/source/i18n/ucal.cpp |
+++ b/source/i18n/ucal.cpp |
@@ -1,6 +1,8 @@ |
+// Copyright (C) 2016 and later: Unicode, Inc. and others. |
+// License & terms of use: http://www.unicode.org/copyright.html |
/* |
******************************************************************************* |
-* Copyright (C) 1996-2015, International Business Machines |
+* Copyright (C) 1996-2016, International Business Machines |
* Corporation and others. All Rights Reserved. |
******************************************************************************* |
*/ |
@@ -25,6 +27,7 @@ |
#include "ustrenum.h" |
#include "uenumimp.h" |
#include "ulist.h" |
+#include "ulocimp.h" |
U_NAMESPACE_USE |
@@ -669,15 +672,8 @@ static const char * const CAL_TYPES[] = { |
U_CAPI UEnumeration* U_EXPORT2 |
ucal_getKeywordValuesForLocale(const char * /* key */, const char* locale, UBool commonlyUsed, UErrorCode *status) { |
// Resolve region |
- char prefRegion[ULOC_FULLNAME_CAPACITY] = ""; |
- int32_t prefRegionLength = 0; |
- prefRegionLength = uloc_getCountry(locale, prefRegion, sizeof(prefRegion), status); |
- if (prefRegionLength == 0) { |
- char loc[ULOC_FULLNAME_CAPACITY] = ""; |
- uloc_addLikelySubtags(locale, loc, sizeof(loc), status); |
- |
- prefRegionLength = uloc_getCountry(loc, prefRegion, sizeof(prefRegion), status); |
- } |
+ char prefRegion[ULOC_COUNTRY_CAPACITY]; |
+ (void)ulocimp_getRegionForSupplementalData(locale, TRUE, prefRegion, sizeof(prefRegion), status); |
// Read preferred calendar values from supplementalData calendarPreference |
UResourceBundle *rb = ures_openDirect(NULL, "supplementalData", status); |