廖雪峰Java10加密与安全-2加密算法-1URL编码

时间:2019-05-07 19:27:59   收藏:0   阅读:141

1.URL编码

URL编码是浏览器发送数据给服务器时使用的编码。
如通过百度搜索美女:

URL编码规则:

public class SplitString {
    public static void main(String[] args) throws Exception{
        String original = "URL参数";
        //编码后
        String encoded = URLEncoder.encode(original,"UTF-8");
        System.out.println("编码后:"+encoded);
        //解码
        String ori = new String(URLDecoder.decode(encoded,"UTF-8"));
        System.out.println("解码后:"+ori);
        char[] cs = original.toCharArray();
    }
}

技术分享图片

2.总结:

原文:https://www.cnblogs.com/csj2018/p/10827345.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!