shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.walker.pay.allinpaycloud.util;
 
import com.walker.infrastructure.utils.StringUtils;
 
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
 
public class TextUtils {
 
    /**
     * 把 x-www-form-urlencoded方式 传送的参数解码成普通字符串。
     * @param raw
     * @return
     * @date 2023-02-26
     */
    public static final String decodeFormUrlParameter(String raw){
        if(StringUtils.isEmpty(raw)){
            return null;
        }
        try {
            return URLDecoder.decode(raw, StringUtils.DEFAULT_CHARSET_UTF8);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
}