且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Java 中取消转义 HTML 字符实体?

更新时间:2022-12-04 21:57:13

我使用了 Apache Commons StringEscapeUtils.unescapeHtml4() 用于此:

I have used the Apache Commons StringEscapeUtils.unescapeHtml4() for this:

取消转义包含实体的字符串转义为包含实际的 Unicode 字符对应于逃逸.支持HTML 4.0 实体.

Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. Supports HTML 4.0 entities.