网页编码问题
在写javaweb是,总是遇到编码问题,一时找不到问题所在。
首先要保证 jsp 以utf-8存储,pageEncoding为utf-8,charset为utf-8.
编码转换问题:调试一下看看哪个对
String tit = new String(title.getBytes("GBK"),"utf8");
String tit1 = new String(title.getBytes("utf-8"),"GBK");
String tit2 = new String(title.getBytes("GBK"),"iso-8859-1");
String tit3 = new String(title.getBytes("iso-8859-1"),"GBK");
String tit4 = new String(title.getBytes("iso-8859-1"),"utf-8");
String tit5 = new String(title.getBytes("utf-8"),"iso-8859-1");