url的中文加密解密





public class tessssst {

    public static void main(String[] args) throws UnsupportedEncodingException {
        String a = "https://%E8%A1%A8%E6%96%B0%E5%BB%BA%E5%B7%A5%E4%BD%9C%E8%A1%A8%E6%96%B0%E5%BB%BA%E5%B7%A5%E4%BD%9C%E8%A1%A8%E6%96%B0%E5%BB%BA%E5%B7%A5%E4%BD%9C%E8%A1%A8.xls";


        String name= URLEncoder.encode(a, "utf-8");


        String name2= URLDecoder.decode(a, "UTF-8");
        System.out.println(name);

        System.out.println(name2);
    }
}














版权声明:本文为weixin_44945027原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。