Issue
I have a Swedish word Pågår
in my string XML file. When I try to read this word form the string resources it only shows P g r
with å
character missing in the output. Why is this happening and how can I solve this? Please help me in solving this error.
Solution
You can (should) escape special letters with the utf-8 representation for it.
Both \u00e5
and å
would work for "å" in Android.
As requested, an example of localized fonts according to link.
To use localized Fonts, you can put the special fonts in assets and name it something like "se-font.ttf
"
In your strings.xml for the Swedish language you add a value:
<string name="fontprefix">se-</string>
Then, in your app, when you load the font, you create the asset filename like so:
String fontasset = getString(R.string.fontprefix, "") + "font.ttf";
Then you should be able to load your font using the fontasset
filename
Answered By - Jave
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.