字符编码字符串用常量替换

This commit is contained in:
Binary Wang 2017-03-21 18:01:30 +08:00
parent 6847a41759
commit bf2b4eed55

View File

@ -491,7 +491,7 @@ public class WxPayServiceImpl implements WxPayService {
HttpPost httpPost = new HttpPost(url);
try (CloseableHttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build()) {
httpPost.setEntity(new StringEntity(new String(requestStr.getBytes("UTF-8"), "ISO-8859-1")));
httpPost.setEntity(new StringEntity(new String(requestStr.getBytes(CharEncoding.UTF_8), CharEncoding.ISO_8859_1)));
try (CloseableHttpResponse response = httpclient.execute(httpPost)) {
String result = EntityUtils.toString(response.getEntity(), Consts.UTF_8);
this.log.debug("\n[URL]: {}\n[PARAMS]: {}\n[RESPONSE]: {}", url, requestStr, result);