String Reversal and Unicode: Why the Simple Implementation Breaks for Emoji and Combining Characters
Reversing a string in JavaScript with split("").reverse().join("") breaks emoji — each emoji is two code units and the split separates them. Here's why naive string reversal fails for Unicode, how surrogate pairs and combining characters cause problems, and the correct grapheme cluster approach in Python and JavaScript.