MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / urlDecode

Function urlDecode

src/webInterface.cpp:129–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129String urlDecode(const String &input) {
130 String output;
131 output.reserve(input.length());
132 for (int i = 0; i < input.length(); ++i) {
133 char c = input[i];
134 if (c == '+') {
135 output += ' ';
136 } else if (c == '%' && i + 2 < input.length()) {
137 char hex[3] = {input[i + 1], input[i + 2], 0};
138 output += static_cast<char>(strtol(hex, nullptr, 16));
139 i += 2;
140 } else {
141 output += c;
142 }
143 }
144 return output;
145}
146
147void parseUrlEncoded(const String &body, WebParamMap &params) {
148 int start = 0;

Callers 2

parseUrlEncodedFunction · 0.85
queryValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected