【发布时间】:2016-07-20 07:22:32
【问题描述】:
我有一个像下面这样的字符串
String input="<div class="prov2Txt">(2)  Notwithstanding anything in any other written law and notwithstanding the making of an oath or declaration of secrecy, a person shall not be guilty of an offence by reason of anything done by him for the purposes of section 6.</div>";
我正在使用 JSOUP 解析它,然后 Jsoup 将所有 Unicode 实体(&#x00a0)删除到 html 实体。
Document d = Jsoup.parse(input);
d.outputSettings(new Document.OutputSettings().prettyPrint(false));
此代码将 &#x00a0 转换为其等效的 HTML 实体。
现在我想在解析输入字符串后保留所有 unicode 实体。
【问题讨论】: