HTML特殊字符解析 [英] HTML speacial character parsing
问题描述
我正在寻找一个java类来解析所有的HTML特殊字符。
我想这是一个常见问题,但我现在找不到一个快速解决方案。
我想要得到的是:
输入:th& egrave; - >输出:
输入:»
输入:& lraquo;
...
你知道对我有用吗?
尝试StringEscapeUtils实用程序类。查看StringEscapeUtils.unescapeHtml()方法的文档。
这里的文档:
http://commons.apache.org/lang/api-release/在这里下载: href =http://commons.apache.org/lang/ =nofollow> http://commons.apache.org/lang/ I'm looking for a java class to parse all HTML special characters.
I guess it's a common problem but i cannot find a fast solution right now. What i wanto to get is: Do you know anything useful for me? Try the StringEscapeUtils utility class. Check the docs for the StringEscapeUtils.unescapeHtml() method. Docs here: http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringEscapeUtils.html Download here: http://commons.apache.org/lang/ 这篇关于HTML特殊字符解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
input: thè --> output: thè
input: »
input: &lraquo;
...