# Les modificateurs d'émojis Unicode sont traités différemment dans les titres et le contenu des publications 👨‍🌾 💁‍♀️

**URL:** <https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328>\
**Category:** UX\
**Tags:** completed\
**Created:** [Mars 11, 2019, 11:52 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328 "2019-03-11T23:52:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [Mars 11, 2019, 11:52 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/1 "2019-03-11T23:52:59Z")

</div>

Les modificateurs d’émojis Unicode ne sont pas gérés de la même manière pour les titres de sujets et le contenu des messages. Dans les titres, ils s’affichent incorrectement.

Par exemple :

Émoji Unicode : `👨‍🌾`  
Dans le contenu du message : 👨‍🌾  
Titre : voir le titre de ce sujet

---

<div class="post-metadata">

**Author:** ![venarius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/venarius/32/133142_2.png) [@venarius](https://meta.discourse.org/u/venarius)\
**Post date:** [Mars 12, 2019, 3:24 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/2 "2019-03-12T15:24:32Z")

</div>

Is happening somewhere in `fancy_title` function in `topic.rb`

Will investigate further.

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [Mars 12, 2019, 3:27 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/3 "2019-03-12T15:27:01Z")

</div>

Oh I know why 😛

This will be fixed by [FEATURE: updates emoji to latest 12.0 version by jjaffeux · Pull Request #7095 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/7095)

Last year, I pushed last emojis before apple had updated the set, using another set for missing emojis.

---

<div class="post-metadata">

**Author:** ![venarius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/venarius/32/133142_2.png) [@venarius](https://meta.discourse.org/u/venarius)\
**Post date:** [Mars 12, 2019, 3:36 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/5 "2019-03-12T15:36:59Z")

</div>

> [@j.jaffeux](#):
>
> This will be fixed by [FEATURE: updates emoji to latest 12.0 version by jjaffeux · Pull Request #7095 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/7095)
> 
> Last year, I pushed last emojis before apple had updated the set, using another set for missing emojis.

Damn… And I thought it had something to do with `unicode_unescape` in `emoji.rb` converting the modifier to its two respective emojis.

`<code>👨&zwj;🌾</code>` =\> 👨 🌾

So close and yet so far ☹ 😃

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [Mars 12, 2019, 3:38 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/6 "2019-03-12T15:38:14Z")

</div>

The title is a different issue yes. Sorry didnt make it clear I was talking of the post content difference.

---

<div class="post-metadata">

**Author:** ![venarius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/venarius/32/133142_2.png) [@venarius](https://meta.discourse.org/u/venarius)\
**Post date:** [Mars 12, 2019, 7:28 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/7 "2019-03-12T19:28:38Z")

</div>

Opened a PR 🙂

[https://github.com/discourse/discourse/pull/7156](https://github.com/discourse/discourse/pull/7156)

With that fix also came an enhancement for the `performEmojiUnescape` function to now also support unicode emojis 🥳

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [Mars 26, 2019, 11:12 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/8 "2019-03-26T11:12:52Z")

</div>

This was merged, thanks @venarius - the topic titles look good now 😃

On a related note, it seems that some Unicode emojis are not being converted properly in post content. Inserting the “woman tipping hand” emoji from iOS results in this: 💁‍♀️

It seems to work correctly, but then inserts an extra ‍♀ for some reason. It works fine in the topic title.

---

<div class="post-metadata">

**Author:** ![venarius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/venarius/32/133142_2.png) [@venarius](https://meta.discourse.org/u/venarius)\
**Post date:** [Mars 26, 2019, 12:06 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/9 "2019-03-26T12:06:10Z")

</div>

@david I will have a look at the post content 🙂 Thanks for the info!

---

<div class="post-metadata">

**Author:** ![venarius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/venarius/32/133142_2.png) [@venarius](https://meta.discourse.org/u/venarius)\
**Post date:** [Mars 28, 2019, 9:39 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/10 "2019-03-28T21:39:53Z")

</div>

Just noticed that it looks correctly in the title because the regex didn’t match on two emojis next to each other, which is why the emojis in the title are currently not escaped and thus the unicode emojis are directly rendered.

Just opened a PR for this.

[https://github.com/discourse/discourse/pull/7282](https://github.com/discourse/discourse/pull/7282)

> [@david](#):
>
> On a related note, it seems that some Unicode emojis are not being converted properly in post content. Inserting the “woman tipping hand” emoji from iOS results in this: 💁‍♀️‍:female\_sign:

Regarding this error I was able to notice that in `lib/emoji/db.json` there is

```plaintext
{
  "code": "1f481",
  "name": "tipping_hand_woman"
}

```

which should be

```plaintext
{
  "code": "1f481-200d-2640-fe0f",
  "name": "tipping_hand_woman"
}

```

@j.jaffeux is there an update needed for the db.json? If yes, I would love to take care of this 🙂

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [Mars 29, 2019, 9:06 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/11 "2019-03-29T09:06:35Z")

</div>

Hi tim,

sorry fixed it directly, it’s honestly not worth PRs and reviews, it’s a matter of copy/pasting few lines and running some rake tasks.

I can however explain you how it happened: previously some emojis were genderless, and then woman/man version were introduced. And if I remember correctly some of the genderless got the woman version and some the man version. Which is exactly what you found out.

If you find another one, here is the process:

- update my small emoji-db project: [ensures womn versions are correctly using woman modifier · jjaffeux/emoji-db@2a85d73 · GitHub](https://github.com/jjaffeux/emoji-db/commit/2a85d7329fea04689cd444357c4879b16ebea14c) (mostly update db.json and run rake)
- run rake emoji:update from discourse root folder once the emoji-db commit is merged [FIX: correctly uses woman version of previously genderless emojis by jjaffeux · Pull Request #7285 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/7285)

And 🎉

💁‍♀️

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [Avril 2, 2019, 5:00 UTC](https://meta.discourse.org/t/unicode-emoji-modifiers-are-handled-differently-in-titles-and-post-content/111328/12 "2019-04-02T17:00:01Z")

</div>

This topic was automatically closed after 28 hours. New replies are no longer allowed.
