URL编码、解码

@Test
public void test() throws UnsupportedEncodingException {
    String url = "%3E%3C";
    // URL解码
    String str = URLDecoder.decode(url, "UTF-8");
    // URL编码
    String str1 = URLEncoder.encode(str, "UTF-8");
    System.out.println(str);
    System.out.println(str1);
}

 

posted @ 2020-12-10 14:39  丿小师傅灬  阅读(60)  评论(0编辑  收藏  举报