diff --git a/src/HttpReq.cpp b/src/HttpReq.cpp index 106192109..4cd4a46ec 100644 --- a/src/HttpReq.cpp +++ b/src/HttpReq.cpp @@ -5,6 +5,28 @@ boost::asio::io_service HttpReq::io_service; +std::string HttpReq::urlEncode(const std::string &s) +{ + const std::string unreserved = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~"; + + std::string escaped=""; + for(size_t i=0; i GamesDBScraper::makeHttpReq(ScraperSearchParams params) if(cleanName.empty()) cleanName = params.game->getCleanName(); - path += "name=" + cleanName; + path += "name=" + HttpReq::urlEncode(cleanName); //platform TODO, should use some params.system get method return std::make_shared("thegamesdb.net", path);