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