From 921f531cb7a7aa896fa85c211906237bc2cbc133 Mon Sep 17 00:00:00 2001 From: John Emmons Date: Fri, 16 Sep 2011 20:22:44 +0000 Subject: [PATCH] ICU-8821 Handle empty set markers in ures_getStringByKeyWithFallback() X-SVN-Rev: 30679 --- icu4c/source/common/uresbund.cpp | 5 +++++ icu4c/source/common/uresimp.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/icu4c/source/common/uresbund.cpp b/icu4c/source/common/uresbund.cpp index 4f694748820..5a0a510daf8 100644 --- a/icu4c/source/common/uresbund.cpp +++ b/icu4c/source/common/uresbund.cpp @@ -1675,6 +1675,11 @@ ures_getStringByKeyWithFallback(const UResourceBundle *resB, ures_getByKeyWithFallback(resB, inKey, &stack, status); retVal = ures_getString(&stack, len, status); ures_close(&stack); + if ( retVal != NULL && u_strlen(retVal) == 3 && retVal[0] == EMPTY_SET && retVal[1] == EMPTY_SET && retVal[2] == EMPTY_SET ) { + retVal = NULL; + *len = 0; + *status = U_MISSING_RESOURCE_ERROR; + } return retVal; } diff --git a/icu4c/source/common/uresimp.h b/icu4c/source/common/uresimp.h index b075d4f9b95..11c3fdd6a12 100644 --- a/icu4c/source/common/uresimp.h +++ b/icu4c/source/common/uresimp.h @@ -30,6 +30,8 @@ #define URES_MAX_ALIAS_LEVEL 256 #define URES_MAX_BUFFER_SIZE 256 +#define EMPTY_SET 0x2205 + /* enum UResEntryType { ENTRY_OK = 0, -- 2.40.0