jsp+oracle中文问题

westdo 2003-03-24 03:23:10
从页面提交数据存储到数据库,中文都变成了乱码,该如何解决?
...全文
28 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
mefaintII 2003-03-24
  • 打赏
  • 举报
回复
last line:
</context-param>

-___-|||
mefaintII 2003-03-24
  • 打赏
  • 举报
回复
if weblogic
add thses into the web.xml

<context-param>
<param-name>weblogic.httpd.inputCharset./*</param-name>
<param-value>GBK</param-value>
<context-param>
rainlin1 2003-03-24
  • 打赏
  • 举报
回复
从数据库读出来同样要进行编码转换。str = new String(str.getBytes("gb2312"),"iso-8859-1");
Amani 2003-03-24
  • 打赏
  • 举报
回复
插入数据库之前进行一下内码转换
String str = "aaa";
str = new String(str.getBytes("iso-8859-1"),"gb2312");
然后再把str插入数据库就行了
UserJavaPerson 2003-03-24
  • 打赏
  • 举报
回复
更新oracle字符集
professional9344 2003-03-24
  • 打赏
  • 举报
回复
String str = request.getParameter("youobject");
str = new String(str.getBytes("8859_1"));

即可编程中文
另外 在文件首加上
<%@ contentType="text/html;charset="gb2312"%>
好运!
laoer 2003-03-24
  • 打赏
  • 举报
回复
数据库中是乱吗?
检查字符集

81,092

社区成员

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

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