public void test4(){
String strUri=“我是一只小绵羊。。。。wsyzxmy。。。12345”;
String encode="";
try {
encode = URLEncoder.encode(strUri, “UTF-8”);
System.out.println(“encode–:”+encode);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
String decode = URLDecoder.decode(encode, “UTF-8”);
System.out.println(“decode–:”+decode);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
java的URL编码与解码
最新推荐文章于 2024-05-03 06:51:32 发布