Question

I want a certain Kanji to be the text of my button in my android application.

I used several kanjis as button labels so far (assigned via android:text in the .xml file) and no problem, but this character:

is for some reason not displayable. I am not sure what the problem is? It is suppose to be a Japanese kanji-character, but is assumedly also used in Chinese. Anyone any ideas why it is not displayable? I defined it like this:

      <Button
                android:id="@+id/radical_162"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="⻌" />
Was it helpful?

Solution

U+2ECC is "CJK RADICAL SIMPLIFIED WALK", which is a Chinese (Han script) character. Japanese Kanji are Chinese characters, just like the Latin letters are shared across a lot of Western languages.

When displaying a Unicode character, if the font being used does not support that character, it typically gets rendered as a square box.

For Android pre-Ice Cream Sandwich, the Droid font (e.g. Droid Sans) is used as the system font. For Ice Cream Sandwich and later, the Roboto font is used. Both of these fonts have poor Unicode character coverage (e.g. not a full set of Unicode 3.0 characters available). Other people have reported different Chinese and other characters missing.

There are Chinese language packs for Android, but I don't know whether these add support for all CJK glyphs in the system font.

The other option is to root the phone/tablet and replace the system font with one that has better Unicode coverage.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top