Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inconsistent Unicode Emoji Glyphs/Symbols

I've been trying to make use of the Unicode symbols for astrology in products for both Apple and iOS. I'm getting inconsistent results, as shown here:

Image of some astrological symbols in a table

Most of these are coming out as I like, but for some reason the Taurus symbol is appearing one way on the first line, following the Moon, and a very different way, with the Emoji-like purple button, when it follows Mars. These results are consistent for different symbols and across Apple hardware; here's a screen capture from my phone showing the same problem with some other signs - Scorpio comes out all right, but Libra and Cancer are buttons.

More symbols in a clip from an iPhone

The strings are extremely straightforward; "Moon Taurus" in the first image is \u263D for Moon, \u2649 for Taurus, basically assembled as [NSString stringWithFormat:@"%@%@", @"\u263D", @"\u2649"]. The "Mars Taurus" image is the same, only with \u2642 for Mars. The string formatting is identical in the different cells of the OSX table, and in the iOS AttributedString.

Any idea what makes these symbols appear one way sometimes, and another way other times?

like image 973
Apollo Grace Avatar asked Apr 15 '15 20:04

Apollo Grace


People also ask

What is a Unicode character example?

Unicode supports more than a million code points, which are written with a "U" followed by a plus sign and the number in hex; for example, the word "Hello" is written U+0048 U+0065 U+006C U+006C U+006F (see hex chart).

Is an emoji a Unicode?

Because emoji characters are treated as pictographs, they are encoded in Unicode based primarily on their general appearance, not on an intended semantic.

How do I type Unicode characters?

Inserting Unicode characters To insert a Unicode character, type the character code, press ALT, and then press X. For example, to type a dollar symbol ($), type 0024, press ALT, and then press X. For more Unicode character codes, see Unicode character code charts by script.

How do I stop Unicode from turning into emojis?

So, if you need to disable emoji in your text, convert the symbol to UTF-8 or UTF-16 sequence ( symbol. codePointAt(0).


1 Answers

Unicode uses variation sequences to select between different renderings for certain code points—listed in the StandardizedVariants.txt file. In your case, the astrological symbols have both "text style" and "emoji style" variants that are selected between by a U+FEOE (text style) or U+FE0F (emoji style) following the code point:

U+2650 U+FE0E: ♐︎

U+2650 U+FE0F: ♐️

Note that correct interpretation of the variation selector depends on support from both the application/framework and the fonts being used. On Chrome (42) there doesn't appear to be any difference between my examples above, but on Safari (8) they are distinct.

like image 138
一二三 Avatar answered Nov 07 '22 05:11

一二三