Return a percent-encoded string
template<
class StringToken = return_string,
class CharSet>
StringToken::result_type
encode(
string_view s,
const CharSet& unreserved,
encoding_opts opt,
StringToken&& token) noexcept;
Declared in file <boost/url/impl/encode.hpp> at line 250
This function applies percent-encoding to the string using the given options and character set, and returns the result as a string when called with default arguments.
encoding_opts opt;
opt.space_as_plus = true;
std::string s = encode( "My Stuff", opt, pchars );
assert( s == "My+Stuff" );
Calls to allocate may throw.