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.

Leave a Comment