java如何还原被转义的HTML特殊字符
我们可以使用
hutool
工具类来进行还原
首先引入pom依赖
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.5.8</version>
</dependency>
HtmlUtil.unescape
还原被转义的HTML特殊字符
String escape = "<html><body>123'123'</body></html>";
// 结果为:<html><body>123'123'</body></html>
String unescape = HtmlUtil.unescape(escape);