Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UTF-8 problem with MySQL 4.0.17

 
V Chauhan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I have a web application which uses MySQL database. Earlier I was using the charset ISO-8859-1 on the jsp pages and all characters ( including special characters such as bullets etc) were being displayed properly.

However I had to change the charset encoding on the jsp pages to utf-8 due to some other requirements. Now all special characters from mysql are displayed as junk characters.

I can not go back to ISO-8859-1. Is there way to ensure that the data from mysql database is displayed correctly with UTF-8 charset?

I tried couple of things:

1. used this flag "?useUnicode=true&characterEncoding=utf-8" in the connection string.
2. tried converting the strings to utf-8 :
byte[] bytes = rs.getBytes(1) ;
String str2 = new String(bytes, "UTF-8");

However both these approaches are not working.

I would really appreciate any thoughts/helps on this.

Thanks in Advance,
Basu.
[ August 22, 2005: Message edited by: Basudev Agrawal ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic