http1::uri::url_encoding

Function encode_with

source
pub fn encode_with<S: AsRef<str>>(input: S, alphabet: impl Alphabet) -> String
Expand description

Encodes a URI component using a custom alphabet for percent-encoding.

This function iterates over the input string and encodes each character that is not part of the given alphabet as a percent-encoded value (e.g., %20 for a space).

§Parameters

  • input: The string to be encoded.
  • alphabet: The set of allowed characters for the URI component encoding.

§Returns

A String representing the encoded URI component.