static long utf8StringLength(byte[] s, int start, int len) {
    long resultLength = 0;
    for (int i = start; i < start + len; i++) {

      /* Byte bit patterns of the form 10xxxxxx are continuation
       * bytes. All other bit patterns are the first byte of
       * a character.
       */
      if ((s[i] & 0xc0) != 0x80) {
        resultLength++;
      }
    }
    return resultLength;
  }
Calculate the length of the strings in the input column vector, and store
it in the output column vector.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringLength.java