Côte d'Ivoire flag emoji not rendering

Hello!

The Côte d’Ivoire (Ivory Coast) flag emoji (e.g., 🇨🇮 [preformatted], 🇨🇮 [normal]) is not showing up right on my hosted Discourse forum site.

I’m on a Mac and I’ve put the emoji via the the mac emoji picker pop-up (I press fn to bring this up).

It renders right when it is in the composer before posting:

But once posted, it renders as text that looks like the correct emoji shortcode syntax:

I tried messing with the emoji short code (:ivory_coast: and using different unicode options for circumflex on the “o” of “côte_d_ivoire”), but it didn’t fix things.

Curious if this issue will show up here on meta when I post this…

UPDATE: I see that the issue doesn’t occur here on Meta. I have tried typing the :côte_d_ivoire: elsewhere in my text so that it’s not next to another emoji short code and I still get the same issue. Note that I myself have not typed in the emoji shortcode. It’s converted automatically by my Discourse install once I input the emoji itself. This doesn’t occur here on Meta.

1 Like

I think I can repro here by adding the one selected from my iPhone-picker after another emoji. Let’s see if it works…

:slight_smile: :côte_d_ivoire:

And a screenshot of the composer:

I’m not sure I can see the 🇨🇮 emoji in the discourse emoji-picker, so maybe it’s an issue from changing away from the apple emoji set to one of the new alternatives? Emojis update

2 Likes

🇨🇮
:cote_divoire:
:côte_d_ivoire:
:cote_d_ivoire:


🇨🇮
:cote_divoire:
:côte_d_ivoire:
:cote_d_ivoire:

@joffreyjaffeux looks like after d38acc5df120e6f3a89d04cf746d2fe03534be29 this broke, seems there’s some inconsistency w.r.t. the diacritic in the emoji gem?

dist/emoji_to_name.json:
  "🇨🇮":": "cote_d_ivoire",

dist/groups.json:
      {
        "name": "cote_d_ivoire",
        "tonable": false
      },

dist/aliases.json:
  "cote_d_ivoire": [
    "cote_divoire"
  ],

dist/emojis.json:
  {
    "name": "côte_d_ivoire",
    "code": "1f1e8-1f1ee"
  },

lib/discourse_emojis/constants.rb:
   "cote_d_ivoire" => ["cote_divoire"],

should we add an alias côte_d_ivoirecote_d_ivoire?
(or maybe the version with the ô should be primary? I don’t know what the “correct” primary is here)

or maybe we just don’t handle diacritics in emoji properly

:tonga:: :tonga:
🇹🇷: :türkiye:
:trinidad_tobago:: :trinidad_tobago:

🇹🇴: :tonga:
🇹🇷: :türkiye:
🇹🇹: :trinidad_tobago:

3 Likes

and the poor :piñata: is also broken, and presumably someone ate all the candy. :confused:

6 Likes

Thanks for looking into this you all. The details are too complex for me as a non-software engineer, but two things in case it’s helpful:

  • I came across this related topic with this point shared here:

    Looks like the cooker is translating the raw emoji into its name, but then doesn’t process it unless enable inline emoji translation is set.

    I tried turning this on and I still had the same issue using the iOS emoji picker.

  • For a future fix re: the diacritics, you might need to also watch out for precomposed (e.g., a single glyph with o and the diacritic baked in) and decomposed (e.g., o + ^ combined separately) unicode characters :thinking:

1 Like

Yes there are all kind of history around this. Will look at these where the conversion went wrong.

1 Like