code: static String hepburn(
          CharSequence text,
          int offset
      ) {
  
          StringBuilder sb = null;
          int n = Math.min(text.length(), offset + 32);
  
          for (int i = offset; i < n; i++) {
              final char c = text.charAt(i);
              char std;
              if (i == offset) { // capitalization
                  std = ((c == '\u00D4') || (c == '\u00F4') || (c == '\u014D') ? '\u014C' : Character.toUpperCase(c));
                  std = ((c == '\u00DB') || (c == '\u00FB') || (c == '\u016B') ? '\u016A' : std);
              } else {
                  std = ((c == '\u00D4') || (c == '\u00F4') || (c == '\u014C') ? '\u014D' : Character.toLowerCase(c));
                  std = ((c == '\u00DB') || (c == '\u00FB') || (c == '\u016A') ? '\u016B' : std);
              }
              std = ((c == '\'') ? '\u2019' : std); // use ’ as apostroph
              std = ((c == ' ') ? '-' : std); // use hyphen instead of space
              if ((sb != null) || (std != c)) {
                  if (sb == null) {
                      sb = new StringBuilder(32);
                      sb.append(text.subSequence(offset, i));
                  }
                  sb.append(std);
              }
          }
  
          return ((sb == null) ? text.subSequence(offset, n).toString() : sb.toString());
  
      }
docs: useful because some computer keyboards don't manage macrons, see => https://en.wikipedia.org/wiki/Macron