Implement grapheme cluster handling for Java