还是中文问题,救急 <%@ page contentType="text/html;charset=gb2312" %>试一下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个我都试过了,结果还是一样的,我在jdk1.4.1的目录下找到了相应的font.properties.zh.Turbo6.0文件,copy覆盖了现有的font.properties文件,得到的结果还是一样,真是搞不懂了 <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 还是不行,是不是不该改原有的font.properties文件? 关键问题是,如果是在win2k系统下,还是用iplanet4.1,但无论是jdk1.4.1还是jdk1.3,显示中文都是正常的。 针对jsp和servlet:解决办法:第一:在jsp页面加入:<%@ page contentType="text/html; charset=gb2312" %>或者在servlet里面 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html; charset=gb2312");//这是重要的上面的如果在不行就用如下的方法在数据入库前进行调用:public static String UnicodeToChinese(String s){ try{ if(s==null||s.equals("")) return ""; String newstring=null; newstring=new String(s.getBytes("ISO8859_1"),"gb2312"); return newstring; } catch(UnsupportedEncodingException e) { return s; } }public static String ChineseToUnicode(String s){ try{ if(s==null||s.equals("")) return ""; String newstring=null; newstring=new String(s.getBytes("gb2312"),"ISO8859_1"); return newstring; } catch(UnsupportedEncodingException e) { return s; } }3:)解决weblogic/webshpere中文问题:在web.xml文件中需要配置中文环境。r如下:<context-param> <param-name>weblogic.httpd.inputCharset./*</param-name> <param-value>GB2312</param-value></context-param> Non supported character set: oracle-character-set-852 hibernate分页查询,第一页数据不全 求解: hibernate dao执行sql异常 请教大家一个比较菜的问题,从jsp向action传一个List类型参数 找不出什么原因?看看是不是数据库连接问题?怎么改好呢? jsp+tomact的问题!!!!!!!!(急) DSFG 如何申明一个这样的数组? 介绍点好书 删除文件的问题 showModalDialog提交到servlet的问题 jsp网页中,如何制作loading...
解决办法:
第一:
在jsp页面加入:
<%@ page contentType="text/html; charset=gb2312" %>
或者在servlet里面
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html; charset=gb2312");//这是重要的
上面的如果在不行就用如下的方法在数据入库前进行调用:
public static String UnicodeToChinese(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}public static String ChineseToUnicode(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}3:)解决weblogic/webshpere中文问题:
在web.xml文件中需要配置中文环境。r如下:
<context-param>
<param-name>weblogic.httpd.inputCharset./*</param-name>
<param-value>GB2312</param-value>
</context-param>