[#boost-urls-decode-01]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::decode
:relfileprefix: ../../
:mrdocs:

`decode` overloads

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode.hpp#Lundefined[boost&sol;url&sol;decode&period;hpp]&gt;`

Return a percent&hyphen;decoded string


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;xref:boost/urls/string_token/StringToken.adoc[string&lowbar;token::StringToken] StringToken = xref:boost/urls/string_token/return_string.adoc[string&lowbar;token::return&lowbar;string]&gt;
system::result&lt;StringToken::result&lowbar;type&gt;
xref:boost/urls/decode-07.adoc[decode](
    core::string&lowbar;view s,
    xref:boost/urls/encoding_opts.adoc[encoding&lowbar;opts] opt = &lcub;&rcub;,
    StringToken&& token = &lcub;&rcub;);
----

[.small]#xref:boost/urls/decode-07.adoc[_» more&period;&period;&period;_]#

Apply percent&hyphen;decoding to an arbitrary string


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;std::size&lowbar;t&gt;
xref:boost/urls/decode-03.adoc[decode](
    char* dest,
    std::size&lowbar;t size,
    core::string&lowbar;view s,
    xref:boost/urls/encoding_opts.adoc[encoding&lowbar;opts] opt = &lcub;&rcub;) noexcept;
----

[.small]#xref:boost/urls/decode-03.adoc[_» more&period;&period;&period;_]#

== Return Value

* A result containing the decoded string in the format described by the passed string token&period;
* The number of characters written to the destination buffer, or an error&period;

== Parameters

[cols="1,4"]
|===
|Name|Description

| *s*
| The string to decode&period;
| *opt*
| The decoding options&period; If omitted, the default options are used&period;
| *token*
| A string token&period;
| *dest*
| The destination buffer to write to&period;
| *size*
| The number of writable characters pointed to by `dest`&period; If this is less than the decoded size, the result is truncated&period;
|===

== See Also

xref:boost/urls/decode-07.adoc[`decode`], xref:boost/urls/decoded_size.adoc[`decoded&lowbar;size`], xref:boost/urls/encoding_opts.adoc[`encoding&lowbar;opts`], xref:boost/urls/string_token/return_string.adoc[`string&lowbar;token&colon;&colon;return&lowbar;string`]&period;

xref:boost/urls/decoded_size.adoc[`decoded&lowbar;size`], xref:boost/urls/encoding_opts.adoc[`encoding&lowbar;opts`], xref:boost/urls/make_pct_string_view.adoc[`make&lowbar;pct&lowbar;string&lowbar;view`]&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
