Côte d'Ivoire flag emoji not rendering

AI-generated summary

Users are reporting that the Côte d’Ivoire flag emoji (:côte_d_ivoire:) is not rendering correctly on hosted Discourse forums, appearing as text instead of the image. donaldsoncd first reported the issue, noting it works in the composer but not after posting, and isn’s reproducible on Meta. JammyDodger was able to reproduce the issue and suggested it might be related to alternative emoji sets. supermathie found inconsistencies in the Discourse emoji gem’s data regarding diacritics and pointed to a recent commit as potentially causing the issue. The problem appears to extend to other emojis with diacritics, such as the :piñata: emoji Lilly. donaldsoncd also shared a related topic about inline emoji translation. joffreyjaffeux confirmed a historical issue with conversions and indicates a fix is in progress, referencing commit https://github.com/discourse/discourse/pull/33220 joffreyjaffeux.

Hello!

The Côte d’Ivoire (Ivory Coast) flag emoji (e.g., 🇨🇮 [preformatted], :côte_d_ivoire: [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.

2 Likes

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 :côte_d_ivoire: 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

:côte_d_ivoire:
:cote_divoire:
:côte_d_ivoire:
:cote_d_ivoire:


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

@j.jaffeux 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_ivoire → cote_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:: :türkiye:
:trinidad_tobago:: :trinidad_tobago:

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

5 Likes

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

7 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.

4 Likes

Situation should be vastly improved by this commit:

https://github.com/discourse/discourse/pull/33220

Thanks for report

7 Likes