We are adding key value pairs in a HashMap
by reading properties file.
While putting key value pair, the key is in Arabic language(Arabic Text) and Value is in English.
In debug mode we can see the key value pair in the HashMap
.
But when we are trying to get values for Arabic key, we are getting null
value.
We even tried to use containsKey
, but its also returning false
.
We have defined property as button.fetch= \u062c\u0644\u0628
and putting it into the HashMap
as
MessageResources resources = getResources(request, mrc[i].getKey());
Iterator itrEntries = mapKeyMethod.entrySet().iterator();
while (itrEntries.hasNext()) {
Map.Entry objEntry = (Map.Entry) itrEntries.next();
String strCaptionKey = (String) objEntry.getKey();
String strMethodName = (String) objEntry.getValue();
String strCaption = resources.getMessage(userLocale, strCaptionKey);
if ((strCaption != null) && !mapCaptionMethod.containsKey(strCaption)) {
mapCaptionMethod.put(strCaption, strMethodName);
}
}
Here value of strCaption
is Arabic text. And when we try to get value with this key from map, it returns null
.