ICU-8864 Use fallback mechanism for empty string in ICUDataTable get method

X-SVN-Rev: 30781
This commit is contained in:
Michael Ow 2011-10-03 19:10:54 +00:00
parent 6655716bad
commit f6b6ce837f

View File

@ -120,7 +120,7 @@ ICUDataTable::get(const char* tableKey, const char* subTableKey, const char* ite
const UChar *s = uloc_getTableStringWithFallback(path, locale.getName(),
tableKey, subTableKey, itemKey,
&len, &status);
if (U_SUCCESS(status)) {
if (U_SUCCESS(status) && len > 0) {
return result.setTo(s, len);
}
return result.setTo(UnicodeString(itemKey, -1, US_INV));