This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

UTF-8 problem with MySQL 4.0.17

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,
[ August 22, 2005: Message edited by: Basudev Agrawal ]
I do some of my very best work in water. Like this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic