java 还原中文utf-8格式编码的字符

在进行https通讯时,服务器接收方收到的中文编码是类似%E4%B8%AD%E5%9B%BD种格式的,那么怎么把他还原呢?
服务器端:
String encodeStr = URLEncoder.encode("中国""utf-8");  
System.out.println("处理后:" + encodeStr); 
 
//处理后:%E4%B8%AD%E5%9B%BD   
 
客户端:
String decodeStr = URLDecoder.decode(encodeStr, "utf-8");  
System.out.println("解码:" + decodeStr);  

猜你喜欢

转载自blog.csdn.net/csdnliuxin123524/article/details/80853035
今日推荐