| 102 | } |
| 103 | |
| 104 | std::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 |
no outgoing calls
no test coverage detected