I have a table 'test' in my database with a column 'msg' that stores strings in various languages like English, Hindi, Telugu, etc.
These strings are displayed properly in the database.
But if i extract it into my java code and print it on the console using system.out.println
, it shows ????????? instead of the actual string.
Is this because the font used in eclipse console does not support these scripts? If so, how can i change the font to something else?
You cannot print the UTF-8 characters on console with its default settings. Make sure the console you use to display the output is also encoded in UTF-8.
Try adding
characterEncoding=UTF-8
parameter to the end of your JDBC connection URL. Even set the table and column character set to UTF-8. This article explains how to do that.Also change the Eclipse console Output encoding using