try {
//解决乱码
String b=new String(title.getBytes("ISO8859-1"),"UTF-8") ;
article.setArticleTitle(b);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
//解决乱码
String b=new String(title.getBytes("ISO8859-1"),"UTF-8") ;
article.setArticleTitle(b);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
title就是从前台传过来的值,试了好几种只有这个方法最好用。