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 27
27
import me .chanjar .weixin .mp .bean .result .*;
28
28
import me .chanjar .weixin .mp .util .http .*;
29
29
import me .chanjar .weixin .mp .util .json .WxMpGsonBuilder ;
30
+
31
+ import org .apache .commons .io .Charsets ;
30
32
import org .apache .http .Consts ;
31
33
import org .apache .http .HttpHost ;
32
34
import org .apache .http .client .ClientProtocolException ;
48
50
import java .io .StringReader ;
49
51
import java .io .UnsupportedEncodingException ;
50
52
import java .net .URLEncoder ;
53
+ import java .nio .charset .Charset ;
51
54
import java .security .NoSuchAlgorithmException ;
52
55
import java .util .*;
53
56
import java .util .Map .Entry ;
@@ -478,7 +481,7 @@ public File qrCodePicture(WxMpQrCodeTicket ticket) throws WxErrorException {
478
481
public String qrCodePictureUrl (String ticket ) throws WxErrorException {
479
482
String url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s" ;
480
483
try {
481
- return String .format (url , URLEncoder .encode (ticket , "utf-8" ));
484
+ return String .format (url , URLEncoder .encode (ticket , Charsets . UTF_8 . name () ));
482
485
} catch (UnsupportedEncodingException e ) {
483
486
WxError error = new WxError ();
484
487
error .setErrorCode (-1 );
You can’t perform that action at this time.
0 commit comments