wjc
2025-04-09 6ae9f81d545f44a85c34dea1c11df8b70e3f940f
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 "";
        }
    }
}