orcle中文乱码问题--- 高手指点!!!

haodema 2004-10-12 02:37:39
开发环境用jbuilderx+weblogic+oracle9i,往数据库中写中文出现乱码,
转换成iso-8859-1编码也不能解决!
...全文
71 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
haodema 2004-10-15
  • 打赏
  • 举报
回复
先谢谢你了
cpl3113 2004-10-12
  • 打赏
  • 举报
回复
jsp中:
<%@ page contentType="text/html; charset=GBK"%>
<%request.setCharacterEncoding("GBK");%>

<HEAD><META http-equiv="Content-Type" content="text/html; charset=GBK"></HEAD>
servlet中:
req.setCharacterEncoding("GBK");
如果还不好使,在存入数据库前用下面函数处理字符串
public String switchChinese(String str) {
try{
String temp;
byte[] temp_byte=str.getBytes("ISO8859-1");
temp=new String(temp_byte,"GBK");
return temp;
}
catch(Exception e){
return null;
}
}




81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧