当前位置: 动力学知识库 > 问答 > 编程问答 >

Display a specific Unicode character on different Android version

问题描述:

I'm currently trying to display a specific Unicode character("\u24BA",Ⓔ) that I receive from my API and try to display it in a TextView.

The display work perfectly on Android 5+. However, when I try on Android 4.2 and 4.4 I got different behavior.

Android 4.2 replace the character by an empty String.

Android 4.4 replace the character by a uppercase E.

My initial though was that Android 4+ font doesn't handle this Unicode character and I decided to implement a Typeface with Roboto_Medium.ttf

Typeface medium = Typeface.createFromAsset(context.getAssets(), "Roboto-Medium.ttf");

name.setTypeface(medium);

name.setText("Ⓔ"); or name.setText(Html.fromHtml("\u24BA");

I got the exact same result as describe above.

Any idea ?

分享给朋友:
您可能感兴趣的文章:
随机阅读: