2

Special characters such as

📂 ★ ✉

Are being replaced with images in the Android OS. As you can see, this seems to affect native TextViews (see screenshot).

enter image description here

My problem is they are also affecting the HTML I am loading through my app via WebView. The main problem is stars of different colors are all showing up as the same gray star. And other than that, you can imagine the visual inconsistency problems that arise.

If you load this page on Chrome for Android, the characters don't load at all. But if you copy the question and paste it into a plain text program such as ColorNote, you will see what I'm experiencing.

Is there a way to get my own WebView or even my entire app to use the font-family, rather than an image?

700 Software
  • 85,281
  • 83
  • 234
  • 341
  • I haven't seen such a problem. As far as I know, Android doesn't have special handling for general Unicode characters--if they're in the font (or fall-back font(s)), they are displayed; otherwise you get a box or something (or nothing). Can you provide code showing how you are displaying this text? Are you using a custom font? What version(s) of Android is showing this problem? Emulator or real device? – Ted Hopp Oct 21 '14 at 18:58
  • Code: `📂, ★ ✉`. I'll post an image shortly so you see what I mean. – 700 Software Oct 21 '14 at 22:10

1 Answers1

1

A wild guess, since I've only heard about this happening on iOS now.

How can I disable the unicode black telephone from being rendered as a red phone on iOS Mail app?

I need help getting a normal looking unicode down arrow in a UILabel like this ⬇

Unicode has this nifty thing that's called "Variation selectors", which can be used, among others, to select a variant shape of a letter, or to select whether a glyph is to be rendered as a black-and-white standard glyph, or as a colourful picture.

This variants are characters \uFE00 to \uFE0F. In case of emoji, \uFE0E means "render the previous character as a black-and-white glyph", and \uFE0F means "try to draw the previous character as a colourful picture".

So in your case, add \uFE0E after the character.

Community
  • 1
  • 1
Karol S
  • 9,028
  • 2
  • 32
  • 45
  • Seems like a good idea, but it didn't work. I tried adding `︎` and it still renders the folder as an orange one. – 700 Software Oct 21 '14 at 22:25
  • @GeorgeBailey have you added it directly after the emojis, or to the end of the string? – Karol S Oct 21 '14 at 23:24
  • Directly. Not even a zero-width space separating the two HTML entities. It would seem that on this regard the iPad got a one up over the Chromium-based WebView on Android. I'll get a co-worker to create images and then I'll be install them later on tomorrow, so that should solve the immediate problem. Still, if there was another way, it would save the time of updating images when we need to tweak the colors, etc. – 700 Software Oct 21 '14 at 23:39
  • Firefox is now introducing images internally. They seem to respect this control character to disable that functionality. – 700 Software Dec 05 '16 at 15:18
  • @GeorgeBailey So it's again Apple implementing the standard wrong – Karol S Dec 05 '16 at 18:03
  • I don't understand. I thought it [didn't work on Android](http://stackoverflow.com/questions/26494156/android-special-characters-converted-to-images-in-webview/26496699?noredirect=1#comment41629094_26496699), but [worked on iOS](http://stackoverflow.com/a/15672714/463304)? – 700 Software Dec 05 '16 at 20:49