JAVA网络编程URL编解码
import java.net.URLDecoder;
import java.net.URLEncoder;
public class CodeDemo {
public static void main(String[] args) throws Exception {
String keyWord = "哇哈哈";
String encode = URLEncoder.encode(keyWord, "UTF-8");
System.out.println("编码之后的内容:"+encode);
String decode = URLDecoder.decode(encode, "UTF-8");
System.out.println("解码之后的内容:"+decode);
}
}