• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

UTF-8 problem with MySQL 4.0.17

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic