1.URL编码
String str = URLEncoder.encode("中文乱码","UTF-8");//编码
String newStr = URLDecoder.decode(str,"UTF-8");//解码
2.new String()
String str = new String("中文乱码".getBytes(),"UTF-8");
1.URL编码
String str = URLEncoder.encode("中文乱码","UTF-8");//编码
String newStr = URLDecoder.decode(str,"UTF-8");//解码
2.new String()
String str = new String("中文乱码".getBytes(),"UTF-8");