java 中文乱码

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");

posted on 2016-10-22 18:11  小董斌  阅读(96)  评论(0编辑  收藏  举报

导航