]> granicus.if.org Git - icu/commitdiff
ICU-8821 Handle empty set markers in ures_getStringByKeyWithFallback()
authorJohn Emmons <emmo@us.ibm.com>
Fri, 16 Sep 2011 20:22:44 +0000 (20:22 +0000)
committerJohn Emmons <emmo@us.ibm.com>
Fri, 16 Sep 2011 20:22:44 +0000 (20:22 +0000)
X-SVN-Rev: 30679

icu4c/source/common/uresbund.cpp
icu4c/source/common/uresimp.h

index 4f6947488203dba1fa3915f55e6dc4a5dbe3f6e5..5a0a510daf8a404474dc3791c8875151f04b60d2 100644 (file)
@@ -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;
 }
 
index b075d4f9b9551a7a67ef60134f8c8e0e0107cda3..11c3fdd6a121b27024f722449c1e8683f3d7cd15 100644 (file)
@@ -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,