github/gemoji — pull request #56 by aroben (2014-08-01 17:39:36+00:00)
Title: Use the same unicode aliases as Safari 7.0.5 on OS X 10.9.4

`Category-Emoji.json` contains many code point sequences ending in U+FE0F VARIATION SELECTOR-16. OS X renders some of these code point sequences as color emoji even if you strip off VARIATION SELECTOR-16. (And in fact it even renders some of them as color emoji if you replace VARIATION SELECTOR-16 with VARIATION SELECTOR-15, even though that is explicitly requesting a "text" variant of the character).

We used to assume that VARIATION SELECTOR-16 was optional for all emoji. But this doesn't match OS X's behavior. This could cause problems, e.g., if you were to use the `unicode_aliases` property to detect Unicode emoji and replace them with images for browsers that don't support emoji natively.

The Ruby code no longer does anything special with VARIATION SELECTOR-16 other than to remove it from the description of each emoji. The new `db/aliases.html` file can be used to determine which the correct Unicode
aliases for each emoji are. That page takes each emoji, generates a set of variants using VARIATION SELECTOR-16 and VARIATION SELECTOR-15, and renders each variant into a `` element twice: once with a red font color, and once with a green font color. If the variant renders the same way, the OS is rendering the variant as a color emoji, and we add it to the "unicodes" array for that emoji.

So the new process for generating `db/emoji.json` is:

1. `rake db:dump > tmp`
2. `mv tmp db/emoji.json`
3. `open -a Safari db/aliases.html`
4. Copy the resulting JSON from Safari
5. `pbpaste > db/emoji.json`

This ensures that `unicode_aliases` only contains those code point sequences which actually render as color emoji on OS X.

/cc @mislav