code: public static <T extends Appendable> boolean escapeUnprintable(T result, int c) {
          try {
              if (isUnprintable(c)) {
                  result.append('\\');
                  if ((c & ~0xFFFF) != 0) {
                      result.append('U');
                      result.append(DIGITS[0xF&(c>>28)]);
                      result.append(DIGITS[0xF&(c>>24)]);
                      result.append(DIGITS[0xF&(c>>20)]);
                      result.append(DIGITS[0xF&(c>>16)]);
                  } else {
                      result.append('u');
                  }
                  result.append(DIGITS[0xF&(c>>12)]);
                  result.append(DIGITS[0xF&(c>>8)]);
                  result.append(DIGITS[0xF&(c>>4)]);
                  result.append(DIGITS[0xF&c]);
                  return true;
              }
              return false;
          } catch (IOException e) {
              throw new IllegalIcuArgumentException(e);
          }
      }
docs: Escape unprintable characters using <backslash>uxxxx notation
  for U+0000 to U+FFFF and <backslash>Uxxxxxxxx for U+10000 and
  above.  If the character is printable ASCII, then do nothing
  and return FALSE.  Otherwise, append the escaped notation and
  return TRUE.