Comparator that orders UTF-16 the same way as UTF-8.
Computes hashcode over a slice of a char[] like Java's String does.