File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes UTF-8 problem with MySQL 4.0.17 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "UTF-8 problem with MySQL 4.0.17" Watch "UTF-8 problem with MySQL 4.0.17" New topic
Author

UTF-8 problem with MySQL 4.0.17

V Chauhan
Ranch Hand

Joined: Nov 15, 2002
Posts: 70
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UTF-8 problem with MySQL 4.0.17
 
Similar Threads
jsp page appears in xml tree format. how can i fix this?
multilingual JSP/Servlets
charset and pageEncoding in jsp
Converting from ISO-8859-1 to UTF-8
UTF-8 vs ISO-8859-1 problem...