Logo Search packages:      
Sourcecode: icu version File versions

Locale U_EXPORT2 Collator::getFunctionalEquivalent ( const char *  keyword,
const Locale locale,
UBool isAvailable,
UErrorCode status 
) [static, inherited]

Return the functionally equivalent locale for the given requested locale, with respect to given keyword, for the collation service. If two locales return the same result, then collators instantiated for these locales will behave equivalently. The converse is not always true; two collators may in fact be equivalent, but return different results, due to internal details. The return result has no other meaning than that stated above, and implies nothing as to the relationship between the two locales. This is intended for use by applications who wish to cache collators, or otherwise reuse collators when possible. The functional equivalent may change over time. For more information, please see the Locales and Services section of the ICU User Guide.

keyworda particular keyword as enumerated by ucol_getKeywords.
localethe requested locale
isAvailablereference to a fillin parameter that indicates whether the requested locale was 'available' to the collation service. A locale is defined as 'available' if it physically exists within the collation locale data.
statusreference to input-output error code
the functionally equivalent collation locale, or the root locale upon error. ICU 3.0

Definition at line 824 of file coll.cpp.

References Locale::createFromName(), Locale::getName(), U_FAILURE, and ULOC_FULLNAME_CAPACITY.

    // This is a wrapper over ucol_getFunctionalEquivalent
    /*int32_t len =*/ ucol_getFunctionalEquivalent(loc, sizeof(loc),
                    keyword, locale.getName(), &isAvailable, &status);
    if (U_FAILURE(status)) {
        *loc = 0; // root
    return Locale::createFromName(loc);

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index