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"))

 

posted @ 2017-06-02 09:45  曲高终和寡  阅读(1730)  评论(0编辑  收藏  举报