onmyway133 / Smile

:smile: Emoji in Swift
https://onmyway133.com/apps/
Other
515 stars 45 forks source link

Smile.unmodify handles ZWJ sequences in potentially unexpected ways #26

Open Sweeper777 opened 2 years ago

Sweeper777 commented 2 years ago

Consider 👩🏻‍❤️‍💋‍👨🏼, which is formed of

If I do

Smile.unmodify(emoji: "👩🏻‍❤️‍💋‍👨🏼")

Everything except the 👩 is removed. This completely changes the meaning of the emoji, which I don't think unmodify is supposed to do. I had expected 👩‍❤️‍💋‍👨 instead. Is this intentional?

onmyway133 commented 2 years ago

Hi, it is expected to keep just the "prominent" info. Maybe you can try disassemble method ?

Sweeper777 commented 2 years ago

Ah, so you have another method for this purpose :) disassemble does remove the modifiers, which is what I want. However, it also removes the heart :(