Java转义形如nbsp;的HTML编码
需要引用一个maven
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.5</version> </dependency>
方法为:
StringEscapeUtils.unescapeHtml3(URLDecoder.decode(data,"utf-8"))