Replace html encoded characters in Java

43 views Asked by At

I want to convert the string <p>&uuml;&egrave;</p> to <p>üé</p>, but both StringEscapeUtils.unescapeHtml4() (from org.apache.commons.text) and HtmlUtils.unescapeHtml() (from org.springframework.web.util) convert it to &lt;p&gt;üè&lt;/p&gt;. Is there a way to keep existing html tags intact?

0

There are 0 answers