jsp中文解决的问题,高手帮忙!!!1 试试<%@ page content="text/html; charset=gb2312" %> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String u=new String(request.getParameter("unitid").getBytes("8859_1"));存入数据库的<%@ page content="text/html; charset=gb2312" %>页面显示 <%@ page contentType="text/html;charset=iso8859_1"%><%response.setContentType("text/html;charset=iso8859_1");%><meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content="text/html; charset=GB2312"> //把数据库中取得的结果转化--显示汉字 public String GS(String str) { try { String temp_p=str; byte[] temp_t=temp_p.getBytes("GBK"); String temp=new String(temp_t,"ISO8859_1"); return temp; } catch(Exception e) { return "null";} } //入库前把表单中提交的中文进行转换 public String toGB(String iso) { String gb=null; if (iso != null) { try { gb=new String(iso.getBytes("ISO8859_1"),"GB2312"); } catch (Exception e) { gb=null; } } return gb; } [在线等,高分]如何设计关闭网站通知? 水贴,尾大的java啊。。。。。 EL表达式取值 求一段简单js代码 更新类以后resin 能不能不重起啊!!! 请各位帮忙看看我的jsp连接mysql哪里出了问题拉 日期型转换为字符型.怎么做? 求助,文件下载出现的问题 在线等待!引用JSP文件怎么出空白页 JB5调试JSP问题 如何去掉IE上的标准按钮、地址栏、链接、电台、 谁知道那里有最新版本的apache可以下,
<%response.setContentType("text/html;charset=iso8859_1");%><meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=GB2312"> //把数据库中取得的结果转化--显示汉字
public String GS(String str)
{ try
{ String temp_p=str;
byte[] temp_t=temp_p.getBytes("GBK");
String temp=new String(temp_t,"ISO8859_1");
return temp;
}
catch(Exception e) { return "null";}
} //入库前把表单中提交的中文进行转换
public String toGB(String iso)
{ String gb=null;
if (iso != null)
{ try { gb=new String(iso.getBytes("ISO8859_1"),"GB2312"); }
catch (Exception e) { gb=null; }
}
return gb;
}