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

encodePathSegment

open static fun encodePathSegment(segment: String, encoding: String): String

Encode the given URI path segment with the given encoding.

Parameters

segment - the segment to be encoded

encoding - the character encoding to encode to

Exceptions

UnsupportedEncodingException - when the given encoding parameter is not supported

Return
the encoded segment

open static fun encodePathSegment(segment: String, charset: Charset): String

Encode the given URI path segment with the given encoding.

Parameters

segment - the segment to be encoded

charset - the character encoding to encode to

Return
the encoded segment

Since
5.0