ICU-5440 Return the correct list of supported locales for collation.

X-SVN-Rev: 20520
This commit is contained in:
George Rhoten 2006-10-10 15:44:51 +00:00
parent 60ce1a0079
commit fe98934f24

View File

@ -548,13 +548,20 @@ ucol_getDisplayName( const char *objLoc,
U_CAPI const char* U_EXPORT2 U_CAPI const char* U_EXPORT2
ucol_getAvailable(int32_t index) 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 U_CAPI int32_t U_EXPORT2
ucol_countAvailable() ucol_countAvailable()
{ {
return uloc_countAvailable(); int32_t count = 0;
Collator::getAvailableLocales(count);
return count;
} }
#if !UCONFIG_NO_SERVICE #if !UCONFIG_NO_SERVICE