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.
In Eclipse for example, you need to go to Run Configuration > Common
-> Encoding -> Select UTF-8 from dropdown.