code: private static String replaceNthArgWithCharsetString(String sig, int stackOffset) {
  
          List<String> arguments = SignatureUtils.getParameterSignatures(sig);
  
          StringBuilder sb = new StringBuilder("(");
          int argumentIndexToReplace = (arguments.size() - stackOffset) - 1;
  
          for (int i = 0; i < arguments.size(); i++) {
              if (i == argumentIndexToReplace) {
                  sb.append(CHARSET_SIG);
              } else {
                  sb.append(arguments.get(i));
              }
          }
  
          sb.append(sig.substring(sig.lastIndexOf(')'), sig.length()));
          return sb.toString();
      }
docs: rebuilds a signature replacing a String argument at a specified spot, with a Charset parameter.
  
  @param sig
  the signature to replace
  @param stackOffset
  the offset of the parameter to replace
  
  @return a new signature with a Charset parameter