Chinese select from DB problem

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

Chinese select from DB problem

Postby koey » Sat Jul 21, 2007 9:13 am

I now discovered that when i query in mysql, the chinese words can display properly

but when I write a java program to get the information inside DB, the chinese words becomes ???? or strange characters.

How can I solve this problem.

I tried many days and finally can narrow down the problem to this. the DB result getting by java is not as expected.
koey
 
Posts: 44
Joined: Fri Jan 19, 2007 5:07 pm

Postby DevelopmentTeam » Sat Jul 21, 2007 9:38 am

I doubt if the problem with '???' is when you are displaying it. ok. Anyhow when you want to read the data from the DB, dont start it in string, but make a formated string like UTF-8 or keep it in raw bytes then when you read it in j2me use the method I posted to display chinese charecters in j2me
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India


Return to J2ME Games

Who is online

Users browsing this forum: No registered users and 1 guest

cron