dcsimg
Conversion from GB2312 to UTF-8
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Deegutla_Chary
Posted On:   Monday, January 13, 2003 06:15 PM

I am processing a marc21 format file which contains GB2312 data. My database is oracle with character set and national character set as UTF-8. I am converting the Gb2312 data into UTF-8 and storing into database.I am doing that as follows.. String strGB2312Data = "Some chinese data"; String strGB = new String(strGB2312Data.getBytes(),"GB2312"); byte [] cbyte = strGB .getBytes("UTF-8"); String strConvUTF = new String(cbyte); Now I am inserting strConvUTF into database. But when i retrieve it back and display in Jsp with charset UTF-8 i am not getting correct data. Some characters are getting corrupted.    More>>

I am processing a marc21 format file which contains GB2312 data.
My database is oracle with character set and national character set as UTF-8.

I am converting the Gb2312 data into UTF-8 and storing into database.I am doing that as follows..


String strGB2312Data = "Some chinese data";

String strGB = new String(strGB2312Data.getBytes(),"GB2312");

byte [] cbyte = strGB .getBytes("UTF-8");

String strConvUTF = new String(cbyte);


Now I am inserting strConvUTF into database.

But when i retrieve it back and display in Jsp with
charset UTF-8 i am not getting correct data.

Some characters are getting corrupted.

Please help me in solving this.


thanks

Chary

   <<Less
About | Sitemap | Contact