Return a percent-decoded string
<boost/url/decode.hpp>template<string_token::StringToken StringToken = string_token::return_string>
system::result<StringToken::result_type>
decode(
core::string_view s,
encoding_opts opt = {},
StringToken&& token = {}) noexcept;
This function percent-decodes the specified string and returns the result using any string_token. The string is validated before decoding; malformed escapes cause the returned result to hold an error.
auto plain = decode( "My%20Stuff" );
assert( plain && *plain == "My Stuff" );
Calls to allocate may throw. Validation errors are reported in the returned result.
| Name | Description |
|---|---|
| s | The string to decode. |
| opt | The decoding options. If omitted, the default options are used. |
| token | A string token. |
decode, decoded_size, encoding_opts, string_token::return_string.