[#boost-urls-decoded_size]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::decoded&lowbar;size
:relfileprefix: ../../
:mrdocs:

Return the buffer size needed for percent&hyphen;decoding

== Synopsis

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;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;std::size&lowbar;t&gt;
decoded&lowbar;size(core::string&lowbar;view s) noexcept;
----

== Description

This function returns the exact number of bytes needed to store the decoded form of the specified string using the given options&period; The string is validated before the size is computed&semi; malformed escapes cause the returned result to contain an error instead&period;

== Example

[,cpp]
----
auto n = decoded_size( "My%20Stuff" );
assert( n && *n == 8 );
----
== Exception Safety

Throws nothing&period; Validation errors are reported in the returned result&period;

== Specification

* https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2&period;1&period; Percent&hyphen;Encoding (rfc3986)]

== Return Value

A result containing the decoded size, excluding any null terminator&period;

== Parameters

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

| *s*
| The string to measure&period;
|===

== See Also

xref:boost/urls/decode-01.adoc[`decode`], 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]#
