File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 2727import me .chanjar .weixin .mp .bean .result .*;
2828import me .chanjar .weixin .mp .util .http .*;
2929import me .chanjar .weixin .mp .util .json .WxMpGsonBuilder ;
30+
31+ import org .apache .commons .io .Charsets ;
3032import org .apache .http .Consts ;
3133import org .apache .http .HttpHost ;
3234import org .apache .http .client .ClientProtocolException ;
4850import java .io .StringReader ;
4951import java .io .UnsupportedEncodingException ;
5052import java .net .URLEncoder ;
53+ import java .nio .charset .Charset ;
5154import java .security .NoSuchAlgorithmException ;
5255import java .util .*;
5356import java .util .Map .Entry ;
@@ -478,7 +481,7 @@ public File qrCodePicture(WxMpQrCodeTicket ticket) throws WxErrorException {
478481 public String qrCodePictureUrl (String ticket ) throws WxErrorException {
479482 String url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s" ;
480483 try {
481- return String .format (url , URLEncoder .encode (ticket , "utf-8" ));
484+ return String .format (url , URLEncoder .encode (ticket , Charsets . UTF_8 . name () ));
482485 } catch (UnsupportedEncodingException e ) {
483486 WxError error = new WxError ();
484487 error .setErrorCode (-1 );
You can’t perform that action at this time.
0 commit comments