10#include <system_error>
15 res.reserve(url_encoded.size());
17 for (
size_t i = 0; i < url_encoded.size(); ++i) {
18 char c = url_encoded[i];
21 if (c ==
'%' && i + 2 < url_encoded.size()) {
22 unsigned int decoded_value{0};
23 auto [p, ec] = std::from_chars(url_encoded.data() + i + 1, url_encoded.data() + i + 3, decoded_value, 16);
27 if (ec == std::errc{} && p == url_encoded.data() + i + 3) {
28 res +=
static_cast<char>(decoded_value);
std::string UrlDecode(std::string_view url_encoded)