absl::UrlUnescape

Performs the inverse transformation of UrlEscape(), converting each percent-encoded sequence of the form "%AB" into the character with the hexadecimal value 0xAB. It returns std::nullopt if any % is not followed by two hexadecimal digits.

Synopsis

Declared in <absl/strings/escaping.h>

[[nodiscard]]
std::optional<std::string>
UrlUnescape(std::string_view input);

Description

UrlUnescape() is identical to UrlUnescapePlus() except that it does not unescape '+' to ' '.

Return Value

The unescaped string, or std::nullopt on malformed input.

NOTE

The return value should not be discarded.

Parameters

NameDescription
inputThe percent-encoded string to unescape.