Topic: 生僻字在程序里为乱码

  Print this page

1.生僻字在程序里为乱码 Copy to clipboard
Posted by: tomyan
Posted on: 2004-05-28 10:41

经过
str=new String(request.getParameter('name').getBytes("8859_1"),"GB2312");转换后写入数据库一般的汉字都正常,但生僻字为乱码.比如 '沄'

2.Re:生僻字在程序里为乱码 [Re: tomyan] Copy to clipboard
Posted by: why
Posted on: 2004-05-28 11:05

Does Java supports GBK18030 ??

3.Re:生僻字在程序里为乱码 [Re: tomyan] Copy to clipboard
Posted by: tomyan
Posted on: 2004-05-28 11:29

哪要如何做呢?

4.Re:生僻字在程序里为乱码 [Re: tomyan] Copy to clipboard
Posted by: weigong94
Posted on: 2004-05-31 01:05

jsp使用charset为GBK即可。

5.Re:生僻字在程序里为乱码 [Re: tomyan] Copy to clipboard
Posted by: tomyan
Posted on: 2004-05-31 11:47

str1=new String((request.getParameter("name")).getBytes("ISO8859-1"),"GB2312");

str2=new String((request.getParameter("name")).getBytes("ISO8859-1"),"GBK");

str3=new String((request.getParameter("name")).getBytes("ISO8859-1"),"GB18030");

一般的汉字都正常,但生僻字为乱码.我试了以上三种编码都不行

6.Re:生僻字在程序里为乱码 [Re: tomyan] Copy to clipboard
Posted by: seeker
Posted on: 2004-06-02 09:48

你写错了,应该是
str1=new String((request.getParameter("name")).getBytes("8859_1"),"GB2312");

7.Re:生僻字在程序里为乱码 [Re: tomyan] Copy to clipboard
Posted by: hexianmao
Posted on: 2004-06-02 11:03

把GB2312编码改为GBK编码即OK了。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923