What's the correct algorithm to determine number of user-perceived-characters?
问题 I have the task of counting the number of perceived characters in an input. The input is a group of ints (we can think of it as an int[] ) which represents Unicode code points. java.text.BreakIterator.getCharacterInstance() is not allowed. (I mean their formula is allowed and is what I wanted, but weaving through their source code and state tables got me nowhere >.<) I was wondering what's the correct algorithm to count the number of grapheme-clusters given some code points? Initially, I'd