I think you missed the part where `i` is not incremented in the for statement, but inside the loop using `Character.charCount`, which returns the number of `char` necessary to represent the code point. If there's something wrong with this, my unit tests have never brought it up, and I am always sure to test with multi-`char` codepoints.
The correct version is:
Java 8 seems to have acquired a codePoints() method on the CharSequence interface which seems to do the same thing.But this just adds to the fact, proper Unicode string processing is a pain :).