如何解码字符串中编码的特殊XML字符? [英] How to decode encoded special XML characters in a string?
本文介绍了如何解码字符串中编码的特殊XML字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到了一个类似
example.com/test?region=us&lang=en&jurisdiction=us
如何编写Java代码以解码
How can I write the java code to decode the encoded characters like
&
字符串中的
.是否有任何现有的类/方法可以对其进行解码?
in the string. Is there any existing class/method to decode them?
谢谢.
推荐答案
要取消转义HTML/XML实体,请使用 ApacheCommons Lang StringEscapeUtils
或本地种植一个.
To unescape HTML/XML entities, use Apache Commons Lang StringEscapeUtils
or homegrow one.
这篇关于如何解码字符串中编码的特殊XML字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文