URLEncode加密文件
{
"agentUniqueParam":"8001",
"city":"%E9%97%B5%E8%A1%8C%E5%8C%BA",
"CallID":"",
"businessId":"4af0acb0-49f7-11ed-bafd-b703d3a52f9f",
"businessStep":"customerReturn",
"signedCustomerName":"%E6%96%97%E7%BD%97%E5%A4%A7%E9%99%86",
"followStage":"%E6%8B%9B%E5%95%86%E8%B7%9F%E8%BF%9B",
"customerStatus":"%E5%B7%B2%E7%AD%BE%E7%BA%A6",
"returnVisitContent":"%E5%BE%85%E5%8F%91%E8%B4%A7%E7%9A%84%E8%AF%B4%E5%BE%97%E5%AE%B9%E6%98%93%E5%92%8C%E4%BA%BA%E5%B7%A5%E5%92%8C%E4%BA%BA",
"businessExecutionTime":"2022-10-12+14%3A29%3A58",
"isEffectiveCustomer":"%E6%98%AF",
"customerId":"2c582f80-49f7-11ed-bafd-b703d3a52f9f",
"otherNoCooperation":"%E8%83%9C%E5%A4%9A%E8%B4%9F%E5%B0%91%E7%9A%84",
"noCooperation":"%E6%88%BF%E5%B1%8B%E8%AF%81%E7%85%A7%E9%97%AE%E9%A2%98%E5%B7%B2%E6%94%BE%E5%BC%83",
"returnWay":"%E7%94%B5%E8%AF%9D",
"callAnsweringStatus":"%E5%B7%B2%E6%8E%A5%E9%80%9A",
"provinces":"%E4%B8%8A%E6%B5%B7%E5%B8%82",
"noSolve":"%E7%99%BB%E9%9D%A9%E7%83%AD",
"firstCustomerType":"A%2B",
"agentName":"8001",
"returnCustomerType":"A",
"businessNumber":"2022101200269",
"timestampKey":"1665556198135",
"encryptionToken":"f113b8afed9410436686714c47f4033e",
"nextStepName":"workComplete",
"CallSheetID":"",
"nextVisitDate":"2022-10-18",
"businessType":"%E5%AE%A2%E6%88%B7%E5%9B%9E%E8%AE%BF",
"account":"N000000035385"
}
URLEncode解密文件
{
"agentUniqueParam":"8001",
"city":"闵行区",
"CallID":"",
"businessId":"4af0acb0-49f7-11ed-bafd-b703d3a52f9f",
"businessStep":"customerReturn",
"signedCustomerName":"斗罗大陆",
"followStage":"招商跟进",
"customerStatus":"已签约",
"returnVisitContent":"待发货的说得容易和人工和人",
"businessExecutionTime":"2022-10-12+14:29:58",
"isEffectiveCustomer":"是",
"customerId":"2c582f80-49f7-11ed-bafd-b703d3a52f9f",
"otherNoCooperation":"胜多负少的",
"noCooperation":"房屋证照问题已放弃",
"returnWay":"电话",
"callAnsweringStatus":"已接通",
"provinces":"上海市",
"noSolve":"登革热",
"firstCustomerType":"A+",
"agentName":"8001",
"returnCustomerType":"A",
"businessNumber":"2022101200269",
"timestampKey":"1665556198135",
"encryptionToken":"f113b8afed9410436686714c47f4033e",
"nextStepName":"workComplete",
"CallSheetID":"",
"nextVisitDate":"2022-10-18",
"businessType":"客户回访",
"account":"N000000035385"
}
代码实现
public static void main(String[] args) throws UnsupportedEncodingException {
String encodeStr = URLEncoder.encode("中国", "utf-8");
System.out.println("处理后:" + encodeStr);
String decodeStr = URLDecoder.decode(encodeStr, "utf-8");
System.out.println("解码:" + decodeStr);
String str = "{\n" +
" \"agentUniqueParam\":\"8001\",\n" +
" \"city\":\"%E9%97%B5%E8%A1%8C%E5%8C%BA\",\n" +
" \"CallID\":\"\",\n" +
" \"businessId\":\"4af0acb0-49f7-11ed-bafd-b703d3a52f9f\",\n" +
" \"businessStep\":\"customerReturn\",\n" +
" \"signedCustomerName\":\"%E6%96%97%E7%BD%97%E5%A4%A7%E9%99%86\",\n" +
" \"followStage\":\"%E6%8B%9B%E5%95%86%E8%B7%9F%E8%BF%9B\",\n" +
" \"customerStatus\":\"%E5%B7%B2%E7%AD%BE%E7%BA%A6\",\n" +
" \"returnVisitContent\":\"%E5%BE%85%E5%8F%91%E8%B4%A7%E7%9A%84%E8%AF%B4%E5%BE%97%E5%AE%B9%E6%98%93%E5%92%8C%E4%BA%BA%E5%B7%A5%E5%92%8C%E4%BA%BA\",\n" +
" \"businessExecutionTime\":\"2022-10-12+14%3A29%3A58\",\n" +
" \"isEffectiveCustomer\":\"%E6%98%AF\",\n" +
" \"customerId\":\"2c582f80-49f7-11ed-bafd-b703d3a52f9f\",\n" +
" \"otherNoCooperation\":\"%E8%83%9C%E5%A4%9A%E8%B4%9F%E5%B0%91%E7%9A%84\",\n" +
" \"noCooperation\":\"%E6%88%BF%E5%B1%8B%E8%AF%81%E7%85%A7%E9%97%AE%E9%A2%98%E5%B7%B2%E6%94%BE%E5%BC%83\",\n" +
" \"returnWay\":\"%E7%94%B5%E8%AF%9D\",\n" +
" \"callAnsweringStatus\":\"%E5%B7%B2%E6%8E%A5%E9%80%9A\",\n" +
" \"provinces\":\"%E4%B8%8A%E6%B5%B7%E5%B8%82\",\n" +
" \"noSolve\":\"%E7%99%BB%E9%9D%A9%E7%83%AD\",\n" +
" \"firstCustomerType\":\"A%2B\",\n" +
" \"agentName\":\"8001\",\n" +
" \"returnCustomerType\":\"A\",\n" +
" \"businessNumber\":\"2022101200269\",\n" +
" \"timestampKey\":\"1665556198135\",\n" +
" \"encryptionToken\":\"f113b8afed9410436686714c47f4033e\",\n" +
" \"nextStepName\":\"workComplete\",\n" +
" \"CallSheetID\":\"\",\n" +
" \"nextVisitDate\":\"2022-10-18\",\n" +
" \"businessType\":\"%E5%AE%A2%E6%88%B7%E5%9B%9E%E8%AE%BF\",\n" +
" \"account\":\"N000000035385\"\n" +
"}";
String json = URLDecoder.decode(str, "utf-8");
System.out.println("解码:" + json);
}
控制台输出
处理后:%E4%B8%AD%E5%9B%BD
解码:中国
解码:{
"agentUniqueParam":"8001",
"city":"闵行区",
"CallID":"",
"businessId":"4af0acb0-49f7-11ed-bafd-b703d3a52f9f",
"businessStep":"customerReturn",
"signedCustomerName":"斗罗大陆",
"followStage":"招商跟进",
"customerStatus":"已签约",
"returnVisitContent":"待发货的说得容易和人工和人",
"businessExecutionTime":"2022-10-12 14:29:58",
"isEffectiveCustomer":"是",
"customerId":"2c582f80-49f7-11ed-bafd-b703d3a52f9f",
"otherNoCooperation":"胜多负少的",
"noCooperation":"房屋证照问题已放弃",
"returnWay":"电话",
"callAnsweringStatus":"已接通",
"provinces":"上海市",
"noSolve":"登革热",
"firstCustomerType":"A+",
"agentName":"8001",
"returnCustomerType":"A",
"businessNumber":"2022101200269",
"timestampKey":"1665556198135",
"encryptionToken":"f113b8afed9410436686714c47f4033e",
"nextStepName":"workComplete",
"CallSheetID":"",
"nextVisitDate":"2022-10-18",
"businessType":"客户回访",
"account":"N000000035385"
}