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

encodeFragment

open static fun encodeFragment(fragment: String, encoding: String): String

Encode the given URI fragment with the given encoding.

Parameters

fragment - the fragment to be encoded

encoding - the character encoding to encode to

Exceptions

UnsupportedEncodingException - when the given encoding parameter is not supported

Return
the encoded fragment

open static fun encodeFragment(fragment: String, charset: Charset): String

Encode the given URI fragment with the given encoding.

Parameters

fragment - the fragment to be encoded

charset - the character encoding to encode to

Return
the encoded fragment

Since
5.0