Java实现:
String encode = URLEncoder.encode("GBK编码", "GBK");
System.out.println("乱码" + encode);
String decode = URLDecoder.decode(encode, "GBK");// GBK解码
System.out.println(decode);
Js实现:
encodeURIComponent(编码的具体内容)
url = encodeURIComponent("http://www.seoalphas.com/")
解码 decodeURIComponent(解码码的具体内容)
decodeURIComponent(url)
网友评论