code: private static String[] toCodePoints(String str) {
          int len = str.codePointCount(0, str.length());
          String[] codePoints = new String[len];
  
          for (int i = 0, offset = 0; i < len; i++) {
              int code = str.codePointAt(offset);
              int codeLen = Character.charCount(code);
              codePoints[i] = str.substring(offset, offset + codeLen);
              offset += codeLen;
          }
          return codePoints;
      }
docs: Break input String into String[]. Each array element represents
  a code point. This method is used for parsing localized digit
  characters and support characters in Unicode supplemental planes.
  
  @param str the string
  @return the array of code points in String[]