MCPcopy Create free account
hub / github.com/CasparCG/server / url_encode

Function url_encode

src/protocol/util/http_request.cpp:104–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104std::string url_encode(const std::string& str)
105{
106 std::stringstream escaped;
107 escaped.fill('0');
108 escaped << std::hex;
109
110 for (auto c : str) {
111 if (std::isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') {
112 escaped << c;
113 } else {
114 escaped << std::uppercase << '%' << std::setw(2) << int((unsigned char)c) << std::nouppercase;
115 }
116 }
117
118 return escaped.str();
119}
120
121}} // namespace caspar::http

Callers 3

cinf_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected