Bitcoin Core  24.99.0
P2P Digital Currency
url.cpp
Go to the documentation of this file.
1 // Copyright (c) 2015-2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <util/url.h>
6 
7 #include <event2/http.h>
8 
9 #include <cstdlib>
10 #include <string>
11 
12 std::string urlDecode(const std::string &urlEncoded) {
13  std::string res;
14  if (!urlEncoded.empty()) {
15  char *decoded = evhttp_uridecode(urlEncoded.c_str(), false, nullptr);
16  if (decoded) {
17  res = std::string(decoded);
18  free(decoded);
19  }
20  }
21  return res;
22 }
std::string urlDecode(const std::string &urlEncoded)
Definition: url.cpp:12