wjc
2025-11-27 8b43d4e1190fc9e2261be0579e53cc6c2987f946
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 "";
        }
    }
}