mac
2024-07-22 55751f180a45e83eeba357a7fdde0375f1a64ea4
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 "";
        }
    }
}