Hacker News new | ask | show | jobs
by amake 476 days ago
> Some emojis require two UTF-16 code units so yep, standard

But not acceptable in a "character counter", in my opinion. What exactly is the use case for this counter, since it won't align with anyone's real-world intuition for the meaning of "character"?

1 comments

You're actually right, I didn't think of this.

My counter is based on JS .length and can get up to 11 characters for specific emojis while X count all emojis as 2 characters.

Thanks for highlighting this