std :: encoding::url
Function std::url_encode
struct String url_encode(const &char s)Percent-encodes every byte except the unreserved set (A-Z a-z 0-9 - _ . ~) — this matches the "component" flavor used for query-string keys/values and path segments (JavaScript's encodeURIComponent, not encodeURI). Space becomes "%20" (not "+" — that's an application/x-www-form-urlencoded convention some callers layer on top, not part of RFC 3986 itself; see form_encode below).