+ { // For select languages + script, route to uldn_localeDisplayName <rdar://problem/51418203>
+ char lang[ULOC_LANG_CAPACITY];
+ char script[ULOC_SCRIPT_CAPACITY ];
+ UErrorCode status = U_ZERO_ERROR;
+ int32_t langlen = uloc_getLanguage(locale, lang, ULOC_LANG_CAPACITY, &status);
+ int32_t scriptlen = uloc_getScript(locale, script, ULOC_SCRIPT_CAPACITY, &status);
+ if ( U_SUCCESS(status) && scriptlen>0 && (uprv_strcmp(lang, "zh") == 0 || uprv_strcmp(lang, "yue") == 0 ||
+ uprv_strcmp(lang, "ks") == 0 || uprv_strcmp(lang, "pa") == 0 || uprv_strcmp(lang, "ur") == 0) ) {
+ ULocaleDisplayNames* uldn = uldn_open(displayLocale, ULDN_STANDARD_NAMES, &status);
+ if ( U_SUCCESS(status) ) {
+ int32_t namelen = uldn_localeDisplayName(uldn, locale, dest, destCapacity, pErrorCode);
+ uldn_close(uldn);
+ return namelen;
+ }
+ }
+ }
+