Multibyte character display in Java console

我怕爱的太早我们不能终老 提交于 2019-12-11 11:44:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!