Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

about encoding convertion from ISO8859-1 to GBK

807607Dec 14 2006 — edited Jan 19 2007
Hi,
i tried to convert a string of 000"testline"111 from iso8859-1 to gbk.
here is the code:

// db stores data in iso8859 encoding
String contractname = rs.getString("contractname");
// change it to gbk
String contractnamegbk = new String(contractname.getBytes("ISO8859-1"),"GBK");

my test page uses GBK charset
and when i display it on the page using <%=contractnamegbk %>

it only shows me 000 missing the "testline"111

anyone knows what the problem is?

thanks very much
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2007
Added on Dec 14 2006
14 comments
729 views