Unicode characters not displayed in TextView.setText
Unfortunately, you just can't do it that way from strings.xml AFAIK.
You're left doing one of two things.
Adding the Unicode character within java to the String in the XML file:
String str = "\u00A9" + getContext().getString(R.string.your_string);
Entering the text as HTML in java:
yourTextView.setText(Html.fromHtml("your chars"));
Hope this is useful.
Android: TextView, unicode character not shown properly
Some fonts don't support some characters. Check your message is shown with other font; include the ttf file on your assets folder, and set the content of the TextView with that font with something like:
yourTextView=(TextView)findViewById(R.id.idOfYourTextView);
Typeface font= Typeface.createFromAsset(getAssets(), "The_Font.TTF");
yourTextView.setTypeface(font);
Hope it helps.
How to show Unicode character in a TextView in Android?
You can parse unicode from html to string by using HTML
library like
val bullet = "•"
print("this is bullet a ${Html.fromHtml(bullet)}")
Display all Unicode chars in TextView
tv=(TextView)findViewById(R.id.textView1);
Typeface font= Typeface.createFromAsset(getAssets(), "TAU_BHON.TTF");
tv.setTypeface(font);
Place the font that will support your language in the assets folder.In this case i have used TAU_BHON.TTF
Related Topics
In Android App Toolbar.Settitle Method Has No Effect - Application Name Is Shown as Title
Why Is Android Studio Reporting "Uri Is Not Registered"
Couldn't Locate Lint-Gradle-Api-26.1.2.Jar for Flutter Project
How to Send Http Post Request and Receive Response
How to Create a Help Overlay Like You See in a Few Android Apps and Ics
How to Use Assert on Android Devices
How to Get the Screensize Programmatically in Android
Android Toast Message Is Not Showing
Show Dialogfragment with Animation Growing from a Point
Using Global Exception Handling on Android
Fusedlocationapi.Getlastlocation Always Null
Android: How to Pass Parcelable Object to Intent and Use Getparcelable Method of Bundle
Measuring Text Height to Be Drawn on Canvas ( Android )
How to Add a Library (Android-Support-V7-Appcompat) in Intellij Idea