code: protected static String convertNonNCNameChar(char c) {
          String str = "" + c;
          byte[] bytes = str.getBytes();
          StringBuilder sb = new StringBuilder(4);
  
          for (int i = 0; i < bytes.length; i++) {
              sb.append(String.format("%x",
                                      bytes[i]));
          }
          return sb.toString().toUpperCase();
      }
docs: /*
  Convert character to hex representation by representing each byte's
  value as upper-cased hex string, as in URL-encoding.