Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

Here's a 1-liner, producing the string "text 0123 漢字":

`String("text EMOJI 0123 漢字".unicodeScalars.filter({ !$0.properties.isEmojiPresentation }))`

(I've had to substitute EMOJI for a smiley face, because HN is bad at text encoding.)



Thanks. Unfortunately both .isEmojiPresentation && .isEmoji leaves many emojis out, like red heart and many other.


Those aren't inherently emojis, the font just shows them as emojis, so you'd have to render the text.


Correct. `isEmojiPresentation` checks if, per the Unicode standard, this scalar should default to an emoji presentation.


It's not a bug, HN deliberately strips emojis.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: