![]() |
Home | Libraries | People | FAQ | More |
Return a percent-encoded string.
Defined in header <boost/url/encode.hpp>
template< class StringToken = string_token::return_string, class CharSet> StringToken::result_type encode( core::string_view s, CharSet const& unreserved, encoding_opts opt = {}, StringToken&& token = {});
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.
The string
|
Name |
Description |
|---|---|
|
|
The string to encode. |
|
|
The set of characters that is not percent-encoded. |
|
|
The options for encoding. If this parameter is omitted, the default options are used. |
|
|
A string token. |
encode,
encoded_size,
encoding_opts,
Convenience header <boost/url.hpp>