How to display korean text on Textview? [closed]

房东的猫 提交于 2019-12-10 18:36:31

问题


I want to display Korean text in my TextView. It should display proper Korean language but instead it's displaying junk chars. Any one know how to fix this?

Thanks in advance.


回答1:


Android use a Unicode font, so it can display Korean character normally. You can try change your text encoding of your project because its not android problem.




回答2:


what you need is to load a korean font to the TextView, like Batang, BatangChe, Dotum..
This is similar question to yours: Display all Unicode chars in TextView




回答3:


You require a True Type font(ttf) file to support the language it seems. copy and paste the korean font file into your assets folder and try this code.

    TextView text = (TextView) findViewById(R.id.textView1);
    Typeface font=Typeface.createFromAsset(activity.getAssets(), "fonts/yourfontname.ttf");
    holder.text.setTypeface(font);
    holder.text.setText(your_variable);


来源:https://stackoverflow.com/questions/7632568/how-to-display-korean-text-on-textview

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