Fixed Emoji Error

Bryan

Active member
Affected version
2.2.15 / 2.3
Not sure if this is a xenforo error or just a generic emoji error but if you try to put 5 england flags in a row, it displays as below:

๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด
 
lol super strange -- can repo only with the england flag

๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿด

Tried with a bunch of others; don't see the same issue.

๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿณ๏ธโ€๐ŸŒˆ

๐Ÿ‡ฆ๐Ÿ‡ฝ๐Ÿ‡ฆ๐Ÿ‡ฝ๐Ÿ‡ฆ๐Ÿ‡ฝ๐Ÿ‡ฆ๐Ÿ‡ฝ๐Ÿ‡ฆ๐Ÿ‡ฝ

๐Ÿ‡ฆ๐Ÿ‡ฑ๐Ÿ‡ฆ๐Ÿ‡ฑ๐Ÿ‡ฆ๐Ÿ‡ฑ๐Ÿ‡ฆ๐Ÿ‡ฑ๐Ÿ‡ฆ๐Ÿ‡ฑ

๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฉ๐Ÿ‡ฟ

๐Ÿ‡ฆ๐Ÿ‡ธ๐Ÿ‡ฆ๐Ÿ‡ธ๐Ÿ‡ฆ๐Ÿ‡ธ๐Ÿ‡ฆ๐Ÿ‡ธ๐Ÿ‡ฆ๐Ÿ‡ธ

๐Ÿ‡ฆ๐Ÿ‡ฉ๐Ÿ‡ฆ๐Ÿ‡ฉ๐Ÿ‡ฆ๐Ÿ‡ฉ๐Ÿ‡ฆ๐Ÿ‡ฉ๐Ÿ‡ฆ๐Ÿ‡ฉ

๐Ÿ‡ฆ๐Ÿ‡ด๐Ÿ‡ฆ๐Ÿ‡ด๐Ÿ‡ฆ๐Ÿ‡ด๐Ÿ‡ฆ๐Ÿ‡ด๐Ÿ‡ฆ๐Ÿ‡ด

๐Ÿ‡ฆ๐Ÿ‡ฎ๐Ÿ‡ฆ๐Ÿ‡ฎ๐Ÿ‡ฆ๐Ÿ‡ฎ๐Ÿ‡ฆ๐Ÿ‡ฎ๐Ÿ‡ฆ๐Ÿ‡ฎ

๐Ÿ‡ฆ๐Ÿ‡ถ๐Ÿ‡ฆ๐Ÿ‡ถ๐Ÿ‡ฆ๐Ÿ‡ถ๐Ÿ‡ฆ๐Ÿ‡ถ๐Ÿ‡ฆ๐Ÿ‡ถ

๐Ÿ‡ฆ๐Ÿ‡ฌ๐Ÿ‡ฆ๐Ÿ‡ฌ๐Ÿ‡ฆ๐Ÿ‡ฌ๐Ÿ‡ฆ๐Ÿ‡ฌ๐Ÿ‡ฆ๐Ÿ‡ฌ

๐Ÿ‡ฆ๐Ÿ‡ท๐Ÿ‡ฆ๐Ÿ‡ท๐Ÿ‡ฆ๐Ÿ‡ท๐Ÿ‡ฆ๐Ÿ‡ท๐Ÿ‡ฆ๐Ÿ‡ท

๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฒ

๐Ÿ‡ฆ๐Ÿ‡ผ๐Ÿ‡ฆ๐Ÿ‡ผ๐Ÿ‡ฆ๐Ÿ‡ผ๐Ÿ‡ฆ๐Ÿ‡ผ๐Ÿ‡ฆ๐Ÿ‡ผ

๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡บ

๐Ÿ‡ฆ๐Ÿ‡น๐Ÿ‡ฆ๐Ÿ‡น๐Ÿ‡ฆ๐Ÿ‡น๐Ÿ‡ฆ๐Ÿ‡น๐Ÿ‡ฆ๐Ÿ‡น

๐Ÿ‡ฆ๐Ÿ‡ฟ๐Ÿ‡ฆ๐Ÿ‡ฟ๐Ÿ‡ฆ๐Ÿ‡ฟ๐Ÿ‡ฆ๐Ÿ‡ฟ๐Ÿ‡ฆ๐Ÿ‡ฟ

๐Ÿ‡ง๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ธ

๐Ÿ‡ง๐Ÿ‡ญ๐Ÿ‡ง๐Ÿ‡ญ๐Ÿ‡ง๐Ÿ‡ญ๐Ÿ‡ง๐Ÿ‡ญ๐Ÿ‡ง๐Ÿ‡ญ

๐Ÿ‡ง๐Ÿ‡ฉ๐Ÿ‡ง๐Ÿ‡ฉ๐Ÿ‡ง๐Ÿ‡ฉ๐Ÿ‡ง๐Ÿ‡ฉ๐Ÿ‡ง๐Ÿ‡ฉ

๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ง

๐Ÿ‡ง๐Ÿ‡พ๐Ÿ‡ง๐Ÿ‡พ๐Ÿ‡ง๐Ÿ‡พ๐Ÿ‡ง๐Ÿ‡พ๐Ÿ‡ง๐Ÿ‡พ

๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ง๐Ÿ‡ช

๐Ÿ‡ง๐Ÿ‡ฟ๐Ÿ‡ง๐Ÿ‡ฟ๐Ÿ‡ง๐Ÿ‡ฟ๐Ÿ‡ง๐Ÿ‡ฟ๐Ÿ‡ง๐Ÿ‡ฟ

๐Ÿ‡ง๐Ÿ‡ฏ๐Ÿ‡ง๐Ÿ‡ฏ๐Ÿ‡ง๐Ÿ‡ฏ๐Ÿ‡ง๐Ÿ‡ฏ๐Ÿ‡ง๐Ÿ‡ฏ

๐Ÿ‡ง๐Ÿ‡ฒ๐Ÿ‡ง๐Ÿ‡ฒ๐Ÿ‡ง๐Ÿ‡ฒ๐Ÿ‡ง๐Ÿ‡ฒ๐Ÿ‡ง๐Ÿ‡ฒ
๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡จ๐Ÿ‡ฆ

๐Ÿ•ž๐Ÿ•ž๐Ÿ•ž๐Ÿ•ž๐Ÿ•ž
๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‡บ๐Ÿ‡ธ

๐Ÿ‡บ๐Ÿ‡ฒ๐Ÿ‡บ๐Ÿ‡ฒ๐Ÿ‡บ๐Ÿ‡ฒ๐Ÿ‡บ๐Ÿ‡ฒ๐Ÿ‡บ๐Ÿ‡ฒ
 
Last edited:
Emoji support is definitely quite buggy.

 
It's an error in our string handling. Some emoji characters are actually several emoji characters which are combined or terminated with special unicode control characters.

We've identified the specific code that does it, and what happens is it trims off invisible control characters from the end of strings. Pretty much all emoji flags are a sequence of characters, but only a few end with something called the "Cancel tag".

It's the "Cancel tag" that is getting stripped in our code, and unfortunately that causes it to render as a black flag. Interestingly, some text editors, if you paste in one of the flags and hit backspace, what it will actually do is remove the "Cancel tag" and also start rendering the black flag.

We've got a potential fix but we're not entirely sure of the repercussions yet.
 
lol super strange -- can repo only with the england flag
Bear in mind it will only happen with certain emoji where it is the last character in the content.

It is confirmed to happen too with the Scottish flag and the Welsh flag. I have no idea why they're all in the UK. If there are other flags that comprise of a final character which is the "Cancel tag" then they would be affected too. Not gonna try them all ;)
 
@Chris D as part of the improvements here, can you increase the result count of emojis from 20 to return back all cases found since emoji list is a list already? I.e. if I search for flag, I was hoping I'd see all emoji's that are flag_ vs a subset. For example, it's impossible to find the american flag, unless you explicitly type flag_us, since flag will stop at first 20 and us will stop at first 20.

Interestingly, if I search for usa, I see a hotdog.... which now that I think about it, probably is correct :D (seriously though, curious how that shows up for usa given usa is not in the name of the emoji :D)
 
This is nothing at all to do with what we're fixing so you'll need to post that somewhere else :)

But the usa case is funny, so I had to check. We have a massive array of all emoji which is generated from JoyPixel's data. Here's the definition for ๐ŸŒญ

PHP:
            '1f32d' => [
                'name' => \XF::phrase('emoji.hotdog'),
                'category_name' => \XF::phrase('emoji_category.food'),
                'category' => 'food',
                'shortname' => ':hotdog:',
                'shortname_alternates' => [':hot_dog:'],
                'humanform' => '0',
                'diversity_base' => '0',
                'diversity' => '',
                'diversity_children' => [],
                'gender' => [],
                'gender_children' => [],
                'keywords' => ['frankfurter', 'hotdog', 'sausage', 'uc8'],  
            ],

Can you spot it yet?

The word sausage contains the letters usa :D
 
So apparently, regional flags often have the convention of being terminated with a "cancel tag" whereas most other flags don't.

It isn't well supported but apparently there is a Texas flag emoji and a California flag emoji. Both of these would terminate with the cancel tag.

But at least there is some logic there and an explanation as to why England, Scotland and Wales flags, being regions of the UK, would have this issue and others do not.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.0 Beta 6).

Change log:
Attempt to strip unicode control characters instead of the broader category of "other" unicode characters.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom