Advertisement:

Author Topic: How did emojis get into my SMF post on my site?  (Read 227 times)

Offline njtweb

  • Sophist Member
  • *****
  • Posts: 1,012
How did emojis get into my SMF post on my site?
« on: February 21, 2020, 01:16:22 PM »
A guest made a post, nothing special in the content verbiage-wise but there is a crossed fingers and praying emoji in the post. I clicked on modify to check the img tag formatting and there's no bbcode at all. How was this person able to do this?

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,631
  • Gender: Male
  • the "mods and tweaks" junkie
    • aegersz on GitHub
    • dopetalk (drugs and users)
Re: How did emojis get into my SMF post on my site?
« Reply #1 on: February 21, 2020, 01:36:07 PM »
I'd say they used their phone or tablet etc. to post that

The configuration of my Linux VPS (SMF 2.0 with 150 mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Offline drewactual

  • Sr. Member
  • ****
  • Posts: 834
    • College Football Fan Site CFB51
Re: How did emojis get into my SMF post on my site? &#128296
« Reply #2 on: February 21, 2020, 01:42:54 PM »
https://unicode.org/emoji/charts/full-emoji-list.html

https://www.simplemachines.org/community/index.php?topic=569059.msg4026546

so far they aren't impacting my sites except to give people pause when they show up in a thread title on teh main board... then i get messages like "how did they do that?"....

strange thing is, sometimes they 'work' and sometimes they render as code..... U+1FAD1   

Offline njtweb

  • Sophist Member
  • *****
  • Posts: 1,012
Re: How did emojis get into my SMF post on my site?
« Reply #3 on: February 21, 2020, 02:13:36 PM »
I tested it out myself in my admin forum from my laptop. I went to Twitter and opened a new tweet. I clicked on 3 emojis to add to the tweet and then highlighted and copied them. Then I pasted them into a new test topic.

Sure enough, all three showed up. When I click on modify they're there exactly the same way in the edit mode as they are in the post mode.

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,075
    • sbulen on GitHub
Re: How did emojis get into my SMF post on my site?
« Reply #4 on: February 21, 2020, 02:18:19 PM »
Yep, true emoji are just characters, & can be copied & pasted from anywhere.  Should work fine in messages & subjects.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline efk

  • Jr. Member
  • **
  • Posts: 242
  • Gender: Male
Re: How did emojis get into my SMF post on my site?
« Reply #5 on: February 21, 2020, 02:56:32 PM »
For 10 years this is the first time to see that something like this is possible, and that part is unexpected "true emoji are just characters, & can be copied & pasted from anywhere". I tried to copy/paste from facebook, but it gives something like :) and :D
I'm wondering how many people knew about this.

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,075
    • sbulen on GitHub
Re: How did emojis get into my SMF post on my site?
« Reply #6 on: February 21, 2020, 03:41:34 PM »
There's a difference between smileys & emoji. 

A smiley is a piece of text that SMF (or any app...) translates to a predefined image.  E.g., the text
Code: [Select]
:) becomes :)

When you copy & paste the smiley, you are usually just copying the actual text.  That's why you saw that when you copied from FB. 

There is a range of characters called emojis/emoticons that are actually just characters - no translation to an image needed.  I find this site very illustrative - you can look up "emoticons" in the U+1F600 ... U+1F64F range:
https://www.utf8-chartable.de/unicode-utf8-table.pl

Your smartphone is actually just showing you an additional set of text characters you can plonk in there, no different from any of these:
  • ಬಾ ಇಲ್ಲಿ ಸಂಭವಿಸು ಇಂದೆನ್ನ ಹೃದಯದಲಿ
  • काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥
  • ⠊⠀⠉⠁⠝⠀⠑⠁⠞⠀⠛⠇⠁⠎⠎⠀⠁⠝⠙⠀⠊⠞⠀⠙⠕⠑⠎⠝⠞⠀⠓⠥⠗⠞⠀⠍⠑
  • 𐌼𐌰𐌲 𐌲𐌻𐌴𐍃 𐌹̈𐍄𐌰𐌽, 𐌽𐌹 𐌼𐌹𐍃 𐍅𐌿 𐌽𐌳𐌰𐌽 𐌱𐍂𐌹𐌲𐌲𐌹𐌸.
  • ᛖᚴ ᚷᛖᛏ ᛖᛏᛁ ᚧ ᚷᛚᛖᚱ ᛘᚾ ᚦᛖᛋᛋ ᚨᚧ ᚡᛖ ᚱᚧᚨ ᛋᚨᚱ
(For a fantastic source of character test data, look here: http://kermitproject.org/utf8.html)

Where the problems come from...  Note that MySQL's implementation of UTF8 is brain-damaged, and does not support 4-byte characters.  Note that these emoji are 4-byte characters.  To work around this, SMF has had to do a lot of translation behind the scenes.  Basically, anywhere a character is entered or displayed needs special treatment for 4-byte chars (translation to/from an html entity).  If that special treatment is missed somehow, you see the goofy entity codes, as drewactual noted above. 

For basic posts & topics, they have worked fine for a while - the occasional odd bug aside, e.g., for a while there post previews didn't work...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp