From fe98934f2447d959237b50c4385b6df22ad9bd5a Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 10 Oct 2006 15:44:51 +0000 Subject: [PATCH] ICU-5440 Return the correct list of supported locales for collation. X-SVN-Rev: 20520 --- icu4c/source/i18n/ucol_res.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/icu4c/source/i18n/ucol_res.cpp b/icu4c/source/i18n/ucol_res.cpp index d8da3051cb..fdd31d688a 100644 --- a/icu4c/source/i18n/ucol_res.cpp +++ b/icu4c/source/i18n/ucol_res.cpp @@ -548,13 +548,20 @@ ucol_getDisplayName( const char *objLoc, U_CAPI const char* U_EXPORT2 ucol_getAvailable(int32_t index) { - return uloc_getAvailable(index); + int32_t count = 0; + const Locale *loc = Collator::getAvailableLocales(count); + if (loc != NULL && index < count) { + return loc[index].getName(); + } + return NULL; } U_CAPI int32_t U_EXPORT2 ucol_countAvailable() { - return uloc_countAvailable(); + int32_t count = 0; + Collator::getAvailableLocales(count); + return count; } #if !UCONFIG_NO_SERVICE