What's cool is that UCS-2 and UTF-16 behave the same way in this regard, so you can see how this works in JavaScript as well. There's a great HN post about the length of an emoji being 2 in JS [1] from 2017.
Practically speaking, I had fun learning this while writing an Angular app to read SMS backups [2]. It's frustrating and cool at the same time.
[1] https://news.ycombinator.com/item?id=13830177
[2] https://github.com/devadvance/sms-backup-reader-2/blob/maste...