java url 编码

public static void main(String[] args) throws UnsupportedEncodingException {
        String encodeUrl = URLEncoder.encode("BF+01601RG-1", "UTF-8");//编码
        System.out.println(encodeUrl);//BF%2B01601RG-1

        String decodeUrl = URLDecoder.decode("BF%2B01601RG-1", "UTF-8");//解码
        System.out.println(decodeUrl);//BF+01601RG-1
    }

猜你喜欢

转载自www.cnblogs.com/ooo0/p/11941372.html
今日推荐