code: public static String encodeFragment(String fragment, String encoding) throws UnsupportedEncodingException {
  		return HierarchicalUriComponents.encodeUriComponent(fragment, encoding, HierarchicalUriComponents.Type.FRAGMENT);
  	}
docs: Encodes the given URI fragment with the given encoding.
  @param fragment the fragment to be encoded
  @param encoding the character encoding to encode to
  @return the encoded fragment
  @throws UnsupportedEncodingException when the given encoding parameter is not supported