不管你的工程是什么编码,只要是地址栏参数,都要转成"ISO-8859-1"编码,才会传输。
public static void testEncode(String path){
try {
String a = new String(path.getBytes("UTF-8"),"ISO-8859-1");
System.out.println(a);
String b = new String(a.getBytes("ISO-8859-1"),"UTF-8");
System.out.println(b);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}