Internationalization when used to translate for Chinese language

时光总嘲笑我的痴心妄想 提交于 2020-02-08 07:42:13

问题


I am having trouble with the Internationalization in my java project.

When translating words from English to Chinese some characters are rendered as question marks.

public static void main(String[] args) 
{
    String lang="ch";
    String country="CH";
    Locale l=new Locale(lang,country);      
    ResourceBundle r = ResourceBundle.getBundle("com.neomandi.prototype/Bundle_ch_CH",l);
    String val = r.getString("average"); 
    System.out.println(st);     
}

I am not able to paste the Chinese word in eclipse. When i do so it changes to \u5E73\u5747.


回答1:


Seems like there is problem with configuration. For pasting unicode character in eclipse change the encoding to unicode. For output display unicode character in output, update run configuration.



来源:https://stackoverflow.com/questions/43472991/internationalization-when-used-to-translate-for-chinese-language

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