Preventing characters from displaying as emoji

I rarely intentionally use emoji, and yet I often run into them unbidden. This is because some Unicode characters double as emoji.

For example, the zodiac symbol for Aries is used both in celestial navigation and in astrology. The latter is much more common, and so when some software sees U+2648 it interprets the character as the emoji for the horoscope sign.

There is a way to prevent this: append the “variation selector” character U+FE0E after the symbol. This tells software that you want the preceding character to be interpreted as a character. And if you want to request that a character be displayed as an emoji, you can append U+FE0F. But a particular software package may or may not honor your request.

I tried this in several terminals to see what would happen. On Linux and Mac, the symbol for Aries (U+2648) prints as an emoji by default, and the symbol for a black pawn (U+265F) does not. But by when I add variation selectors to reverse the defaults the shells complied.

Here’s the same output as text:

    >>> print("\u2648")
    ♈
    >>> print("\u2648\ufe0e")
    ♈︎
    >>> print("\u265f")
    ♟
    >>> print("\u265f\ufe0f")
    ♟️

When I tested this on Windows I got different results in different terminals. The default cmd terminal was unable to display display either Aries or the pawn. The ConEmu terminal displayed both as characters, even when I requested emoji. The new Windows Terminal app displayed both as emoji, even when I requested plain characters. This probably has something to do with the fonts the terminals use as well as the terminal software itself.

Update: View this page to see how your browser renders various characters as text or emoji. Also see this Twitter thread on how Twitter renders these characters.

2 thoughts on “Preventing characters from displaying as emoji

  1. ” append the “variation selector” character ….. after the symbol. This tells …. that you want the preceding character to be interpreted as …”

    Isn’t this how Egyptian hieroglyphics worked?

  2. The first page you link in your update is fascinating. Sometimes in a “set” of characters (such as map symbols or media player controls) different characters will have different default renderings. Results are also different between Firefox and Chrome. I’d love to hear some of the “war stories” behind these decisions.

Leave a Reply

Your email address will not be published. Required fields are marked *