How to display Gujarati text from database
I am using a SQLite database which is in Gujarati language. When I show data from this database in my app, it appears as some garbage characters (some boxes or rectangles). I am using the following code to set the Gujarati font in my app;
Typefa开发者_运维知识库ce typeface = Typeface.createFromAsset(getAssets(),"FontName.ttf");
buttonsetTypeface(typeface);
button.setText(StringEscapeUtils.unescapeXml(a[i]).trim());
What do I have to do so that the text appears properly in Gujarati?
Maybe your android phone has to be setup to support the language. Apparently the language code is 'gu' if that helps.
精彩评论