是不是您碰到了编码的问题如果是jsp页面
public String togb(String iso)
{
String gb=null;
if (iso != null) {
try {
gb=new String(iso.getBytes("ISO-8859-1"),"GB2312");
} catch (Exception e) {
gb=null;
}
}
return gb;
}
或是直接
<%@ page contentType="text/html; charset=gb2312" %>
<% out.println("中文"); %>
就可以了
更详细的请看http://www.chinajavaworld.com/bbsoffline/jinghuaforum2/764.html
public String togb(String iso)
{
String gb=null;
if (iso != null) {
try {
gb=new String(iso.getBytes("ISO-8859-1"),"GB2312");
} catch (Exception e) {
gb=null;
}
}
return gb;
}
或是直接
<%@ page contentType="text/html; charset=gb2312" %>
<% out.println("中文"); %>
就可以了
更详细的请看http://www.chinajavaworld.com/bbsoffline/jinghuaforum2/764.html
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货