spring-framework / org.springframework.web.util / UriUtils / encodeHost

encodeHost

open static fun encodeHost(host: String, encoding: String): String

Encode the given URI host with the given encoding.

Parameters

host - the host to be encoded

encoding - the character encoding to encode to

Exceptions

UnsupportedEncodingException - when the given encoding parameter is not supported

Return
the encoded host

open static fun encodeHost(host: String, charset: Charset): String

Encode the given URI host with the given encoding.

Parameters

host - the host to be encoded

charset - the character encoding to encode to

Return
the encoded host

Since
5.0