If you want to write programs that manipulate text then you had better get some libraries that are cluster aware because you are not going to get it right on your own.
Don't think that Emoji are free. post
To sum up, these are seven ways emoji can be encoded: 1. A single codepoint đ§ U+1F9DB 2. Single codepoint + variation selector-16 âšď¸ U+2639 + U+FE0F = âšď¸ 3. Skin tone modifier 𤾠U+1F935 + U+1F3FD = đ¤ľđ˝ 4. Zero-width joiner sequence đ¨ + ZWJ + đ = đ¨âđ 5. Flags đŚ + đą = đŚđą 6. Tag sequences đ´ + gbsct + U+E007F = đ´ó §ó ˘ó łó Łó ´ó ż 7. Keycap sequences * + U+FE0F + U+20E3 = *ď¸âŁ