我向 php 文件发送查询以接收 xml:
www.mydomain.com/order.php?item=€15,- shoes
对于 HTML,我需要 €-sign 为: & euro ;
我试过:
try {
query=URLEncoder.encode(query,"UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
和 POST-url=www.mydomain.com/order.php?query
问题在于 = 符号也被编码,我得到 & euro 的错误;(标志):
Caused by: java.lang.IllegalArgumentException: Illegal character in query at index
如何编码此查询?