当前位置:网站首页>Unified ordering background interface product description Chinese garbled

Unified ordering background interface product description Chinese garbled

2022-07-06 08:27:00 Cabbage s

  1. When wechat pays, the product description is garbled as shown in the figure below  Insert picture description here

  2. resolvent

//1  assemble body No conversion coding is required for parameters 
//2 MD5 Encryption requires UTF-8 
 public static String MD5Encode(String origin, String charsetname) {
    
        charsetname="utf-8";
        String resultString = null;
        try {
    
            resultString = new String(origin);
            MessageDigest md = MessageDigest.getInstance("MD5");
                resultString = byteArrayToHexString(md.digest(origin
                        .getBytes(charsetname)));
        } catch (Exception exception) {
    
        }
        return resultString.toUpperCase();
    }
    //3  No conversion coding is required when requesting wechat 
  1. When the project starts add to Encoding settings -Dfile.encoding=UTF-8
    Such as The startup command is java -jar xx.jar Change it to
    java -Dfile.encoding=UTF-8 -jar xx.jar
原网站

版权声明
本文为[Cabbage s]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131825279481.html