diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java index c3e8f4cf..5d165393 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java @@ -252,13 +252,14 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl { } private StringEntity createEntry(String requestStr) { - try { - return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); - } catch (UnsupportedEncodingException e) { - //cannot happen - this.log.error(e.getMessage(), e); - return null; - } + return new StringEntity(requestStr, ContentType.create("application/json", "utf-8")); +// try { +// return new StringEntity(new String(requestStr.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1)); +// } catch (UnsupportedEncodingException e) { +// //cannot happen +// this.log.error(e.getMessage(), e); +// return null; +// } } private HttpClientBuilder createHttpClientBuilder(boolean useKey) throws WxPayException {