diff --git a/icu4c/source/i18n/ucol.cpp b/icu4c/source/i18n/ucol.cpp index 273296d0dd..73241be07a 100644 --- a/icu4c/source/i18n/ucol.cpp +++ b/icu4c/source/i18n/ucol.cpp @@ -8787,6 +8787,11 @@ ucol_equal( const UCollator *coll, /* returns the locale name the collation data comes from */ U_CAPI const char * U_EXPORT2 ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status) { + return ucol_getLocaleByType(coll, type, status); +} + +U_CAPI const char * U_EXPORT2 +ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status) { const char *result = NULL; if(status == NULL || U_FAILURE(*status)) { return NULL; diff --git a/icu4c/source/i18n/unicode/ucol.h b/icu4c/source/i18n/unicode/ucol.h index 699d59cb55..cbc0ab3461 100644 --- a/icu4c/source/i18n/unicode/ucol.h +++ b/icu4c/source/i18n/unicode/ucol.h @@ -786,12 +786,29 @@ ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int3 * @return real locale name from which the collation data comes. * If the collator was instantiated from rules, returns * NULL. - * @stable ICU 2.1 + * @deprecated ICU 2.8 Use ucol_getLocaleByType instead */ U_CAPI const char * U_EXPORT2 ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status); +/** + * gets the locale name of the collator. If the collator + * is instantiated from the rules, then this function returns + * NULL. + * @param coll The UCollator for which the locale is needed + * @param type You can choose between requested, valid and actual + * locale. For description see the definition of + * ULocDataLocaleType in uloc.h + * @param status error code of the operation + * @return real locale name from which the collation data comes. + * If the collator was instantiated from rules, returns + * NULL. + * @draft ICU 2.8 + */ +U_CAPI const char * U_EXPORT2 +ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status); + /** * Get an Unicode set that contains all the characters and sequences tailored in * this collator. The result must be disposed of by using uset_close.