换用jdk7自带charset常量类

This commit is contained in:
BinaryWang 2016-07-11 18:07:05 +08:00
parent 2923512a83
commit 065156e81b

View File

@ -51,6 +51,7 @@ import java.io.InputStream;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.Map.Entry;
@ -526,7 +527,7 @@ public class WxMpServiceImpl implements WxMpService {
String url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s";
try {
String resultUrl = String.format(url,
URLEncoder.encode(ticket, Charsets.UTF_8.name()));
URLEncoder.encode(ticket, StandardCharsets.UTF_8.name()));
if(needShortUrl){
return this.shortUrl(resultUrl);
}