高分求教:中文显示的问题 http://www2.ccw.com.cn/02/0224/c/0224c05_4.asp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String str=new String((request.getParameter("name")).getBytes("ISO8859-1"),"gb2312")%insert into tb_student values ('"+str +"',.........); <%@ page contentType="text/html; charSet=GBK" %>加入即可 用楼上的楼上的东西或者用个中文处理函数public String getStr(String str){ try{ String temp_p=str; byte[] temp_t=temp_p.getBytes("ISO8859-1"); String temp=new String(temp_t); return temp; }catch(Exception e){} return "null";} 上边怎么实现方法都写了,我要说的是你把这种方法在插入数据库前调用一次,保证是ISO-8859-1,调出来再转换一次,变为GB2312.搜索相同的问题,为什么大家都不用搜索?? 需要文字编码转换你可以在没有往数据库中添加之前在页面中print出来看看是不是乱码试一试这个函数 public String getChinese(String str){ try{ String str1=str; byte[] str2=str1.getBytes("ISO8859-1"); String temp=str2.toString(); return temp; } catch(Exception e) { } return "Null"; } 怎么用java实现多屏幕图像处理和显示系统设计急急急!!!! 新手servlet求助~ JSP的一句useBean动作指令 紧急求救,郁闷了一宿,还是没有弄出来 9命啊杀人了 能否将JAVA中的JAVALIST对象传给javascript? 紧急求救,跪求高手帮忙 添加到数据库的问题求助!!!!!!!! Struts中struts-config.xml中<blobal-forwards></blobal-forwards>有什么作用,我不用它也一样实现forwards呀? ireport图标报表html显示问题 struts配置问题,请好心人入内,人人有分!!!! 如何解决中文乱码的问题?
insert into tb_student values ('"+str +"',.........);
加入即可
try{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}catch(Exception e){}
return "null";
}
搜索相同的问题,为什么大家都不用搜索??
你可以在没有往数据库中添加之前在页面中print出来看看是不是乱码
试一试这个函数
public String getChinese(String str){
try{
String str1=str;
byte[] str2=str1.getBytes("ISO8859-1");
String temp=str2.toString();
return temp;
}
catch(Exception e)
{
}
return "Null";
}