Sometimes I get data feed like this: -65° to 180°F
. I unescaped this HTML, which will give me -65° to 180°F. whereas what I need is -65° to 180°F. Which brings me to conclusion that I need to unescape the HTML twice.
I've use this simple code to unescapeHTML twice.
String newtext = StringEscapeUtils.unescapeHtml(text);
String newtext2 = StringEscapeUtils.unescapeHtml(newtext);
But when I print the newtext2 contents, it's still shows -65° to 180°F. This still happened even if I unescaped it thrice. Why did the unescapeHTML can't unescape the HTML the second time? How can I work around this?