3 ms·
How's it different from any other combining character?
by peteretep 11y ago
How's it different from any other combining character?
- masklinn 11y agoIt's not, jameshart just learned about something which has been an issue in reversing unicode text since 1991. So yay for unicode skin tones I say, just as emoji brought to light all the broken handling of astral characters out there, skin tones might finally bring some light to combining characters for all the anglo-centric developers out there who couldn't be arsed to learn about the issue when it didn't affect them.
- jameshart 11y agoWell thanks for assuming ignorance rather than amusement on my part. I've always found the entire concept of reversing a string amusing enough, now I get to add another example of why the entire problem is ill-defined. What is the reverse of the 'white woman hearts black man' emoji? Is it a 'black man hearts white woman' emoji? The realistic string handling problem this will at least bring to light is probably more likely to be an issue with strong truncation than with ill-formed interview questions. As you say, if this brings the risk of splitting combining characters to the fore maybe more software will handle it in the future.
- peteretep 11y ago> What is the reverse of the 'white woman hearts black > man' emoji? Is it a 'black man hearts white woman' emoji No, because when denormalized it consists of codepoints joined by U+200D ZERO WIDTH JOINER, which suggests it's a single grapheme, which means you shouldn't break it apart when reversing.