2016-08-02 11:18:45 INFO - third_ruanyun 软云流量回调返回参数,json={"orderid":"2606944","ordercode":104,"channelcode":"","failmsg":"\u7cfb\u7edf\u672a\u77e5\u9519\u8bef","transno":"1608020650006995","subtransno":"","completiontime":"2016-08-02 11:06:10"}
2016-08-02 11:18:45 INFO - third_ruanyun 软云流量返回内容中乱码解码后为:\u7cfb\u7edf\u672a\u77e5\u9519\u8bef
2016-08-02 11:18:45 INFO - third_ruanyun 软云流量返回参数,orderid=2606944,ordercode=104,channelcode=,failmsg=\u7cfb\u7edf\u672a\u77e5\u9519\u8bef,transno=1608020650006995,completiontime=2016-08-02110610
上面的是日志,我的new String()转码怎么转不过来,在本地测试是可以的,线上就不行,我猜测是我在本地测试时我的String有问题,和传过来的参数不一致,请问大神们可以指导一下吗,谢谢了
log.info("third_ruanyun 软云流量回调返回参数,json=" + json);
json = json.replaceAll("[{},: ]", "").trim();
json = json.replaceAll("[\\[\\]]", "").trim();
json = json.substring(1, json.length() - 1);
String[] codes = json.split("\"\"|\"");
for (int i = 0; i < codes.length; i++) {
if ("orderid".equals(codes[i])) {
orderid = codes[i + 1];
}
if ("ordercode".equals(codes[i])) {
ordercode = codes[i + 1];
}
if ("channelcode".equals(codes[i])) {
channelcode = codes[i + 1];
}
if ("failmsg".equals(codes[i])) {
failmsg = codes[i + 1];
}
if ("transno".equals(codes[i])) {
transno = codes[i + 1];
}
if ("completiontime".equals(codes[i])) {
completiontime = codes[i + 1];
}
}
}
String failmsgNew=new String(failmsg);
log.info("third_ruanyun 软云流量返回内容中乱码解码后为:"+failmsgNew);
log.info("third_ruanyun 软云流量返回参数,orderid=" + orderid + ",ordercode=" + ordercode + ",channelcode=" + channelcode + ",failmsg=" +failmsgNew + ",transno=" + transno + ",completiontime="
+ completiontime);