问题
I have some text to be printed in Tamil. How can I get it printed in Tamil on Java console. I'm testing a piece of code and for debugging I require to see the text being printed.
public static void main(String[] args) {
String str = "வீடிவீடிவீடிவீடிவீடி";
System.out.println("String is : "+str);
}
Shows output in java console as
String is : ?????????????
回答1:
If you use Eclipse Ide change bottom configurations and try.
Window > Preferences > General > Content Types, set UTF-8 as the default encoding for all content types. Window > Preferences > General > Workspace, set "Text file encoding" to "Other : UTF-8".
回答2:
- First Solution
I'm not sure but you can use open tamil jar for it.
see this might help you.
- Second Solution
Got to project Properties-> Resource->change the Radio button to "Other"-> and select "UTF-8" from drop down.
In my eclipse its working.
来源:https://stackoverflow.com/questions/37132530/multibyte-character-display-in-java-console