code: public static String escapeUriFragmentId(final String text, final String encoding) {
          if (encoding == null) {
              throw new IllegalArgumentException("Argument 'encoding' cannot be null");
          }
          return UriEscapeUtil.escape(text, UriEscapeUtil.UriEscapeType.FRAGMENT_ID, encoding);
      }
docs: <p>
  Perform am URI fragment identifier <strong>escape</strong> operation
  on a <tt>String</tt> input.
  </p>
  <p>
  The following are the only allowed chars in an URI fragment identifier (will not be escaped):
  </p>
  <ul>
  <li><tt>A-Z a-z 0-9</tt></li>
  <li><tt>- . _ ~</tt></li>
  <li><tt>! $ &amp; ' ( ) * + , ; =</tt></li>
  <li><tt>: @</tt></li>
  <li><tt>/ ?</tt></li>
  </ul>
  <p>
  All other chars will be escaped by converting them to the sequence of bytes that
  represents them in the specified <em>encoding</em> and then representing each byte
  in <tt>%HH</tt> syntax, being <tt>HH</tt> the hexadecimal representation of the byte.
  </p>
  <p>
  This method is <strong>thread-safe</strong>.
  </p>
  
  @param text the <tt>String</tt> to be escaped.
  @param encoding the encoding to be used for escaping.
  @return The escaped result <tt>String</tt>. As a memory-performance improvement, will return the exact
  same object as the <tt>text</tt> input argument if no escaping modifications were required (and
  no additional <tt>String</tt> objects will be created during processing). Will
  return <tt>null</tt> if input is <tt>null</tt>.