mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
uft-8 改为 StandardCharsets.UTF_8
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.common.util.wxplatform;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
@@ -10,7 +11,7 @@ import java.util.Arrays;
|
||||
* @Date 2023/7/27 16:18
|
||||
*/
|
||||
public class PKCS7Encoder {
|
||||
static Charset CHARSET = Charset.forName("utf-8");
|
||||
static Charset CHARSET = StandardCharsets.UTF_8;
|
||||
static int BLOCK_SIZE = 32;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,16 +6,16 @@ import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.StringReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 提供接收和推送给公众平台消息的加解密接口(UTF8编码的字符串).
|
||||
@@ -32,7 +32,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
* </ol>
|
||||
*/
|
||||
public class WXBizMsgCrypt {
|
||||
static Charset CHARSET = Charset.forName("utf-8");
|
||||
static Charset CHARSET = StandardCharsets.UTF_8;
|
||||
Base64 base64 = new Base64();
|
||||
byte[] aesKey;
|
||||
String token;
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -47,7 +48,7 @@ public class WXXmlToMapUtil {
|
||||
Map<String, String> data = new HashMap<>();
|
||||
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
|
||||
InputStream stream = new ByteArrayInputStream(xml.getBytes("UTF-8"));
|
||||
InputStream stream = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8));
|
||||
org.w3c.dom.Document doc = documentBuilder.parse(stream);
|
||||
doc.getDocumentElement().normalize();
|
||||
NodeList nodeList = doc.getDocumentElement().getChildNodes();
|
||||
|
||||
Reference in New Issue
Block a user