Subscript 2 is displayed correctly in all the following cases:
Directly pasting the utf-8 character
<string name="subscript_two">₂</string>
Using the hex escape
<string name="subscript_two">₂</string>
Using the decimal escape
<string name="subscript_two">₂</string>
But all the following cases display subscript 5 as regular 5.
Directly pasting the utf-8 character
<string name="subscript_five">₅</string>
Using the hex escape
<string name="subscript_five">₅</string>
Using the decimal escape
<string name="subscript_five">₅</string>
What's up with that?
It is rendered correctly in Android Studio's Layout Preview (on API 23), but not on my testing device that runs on CM 11, which is a fork of Kitkat 4.4.4 .
Now I know the Html.fromHtml()
hack answered here, but I expect there's a cleaner way to make it happen in strings.xml itself - since subscript 2 works just fine.
I need it for putting P₂O₅ in EditText's hint and TextView, btw.