mac
2024-05-22 50101e1b1c152c5346a6f4e63a7c6db98809e4d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.hdl.photovoltaic.utils;
 
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
 
/**
 * 编码加码
 */
public class URLEncodingUtils {
    public static String encodeURIComponent(String value) {
        try {
            return URLEncoder.encode(value, "UTF-8")
                    .replace("+", "%20")
                    .replace("*", "%2A")
                    .replace("%7E", "~");
        } catch (Exception e) {
            return "";
        }
    }
}