访问URL加码解码(接收url的json数据 中文转码)

[服务器端](https://www.baidu.com/s?wd=%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF&tn=SE_PcZhidaonwhc_ngpagmjz&rsv_dl=gh_pc_zhidao):

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);

//解码:中国

你可能感兴趣的:(访问URL加码解码(接收url的json数据 中文转码))