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