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 Reg loading Unicode data from DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Reg loading Unicode data from DB" Watch "Reg loading Unicode data from DB" New topic
Author

Reg loading Unicode data from DB

Sathya Sekar
Greenhorn

Joined: Dec 17, 2003
Posts: 15
Hello friends,

I have a basic doubt wrt to ensuring internationalization support in Java applications. In my Java code, I try to "enforce" UTF8 encoding by doing:



However, when the data value in the database is , the resultant string is mangled up :

However if I remove the encoding and just retain the String in the above code:



the output is fine:[CODE]Localiza��o Amostra[/CPDE]

I am collecting information on the database but it might be UTF-16 as well. I am unclear on what I am doing wrong and what I should be doing to ensure internalionalization completely.

Could any kind soul pl help?

Thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Do this:

and nothing else. The database driver and the database between them should take care of any encoding issues. And from what you say in your second example, that is already working. I don't understand why you think you have to do anything else.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg loading Unicode data from DB