code: private int[] toCodePointArray(String input) {
      int len = input.length();
      int[] codePointArray = new int[input.codePointCount(0, len)];
      for (int i = 0, j = 0; i < len; i = input.offsetByCodePoints(i, 1)) {
        codePointArray[j++] = input.codePointAt(i);
      }
      return codePointArray;
    }
docs: convert from string to code point array