MCPcopy Create free account
hub / github.com/defold/defold / Decode

Function Decode

engine/dlib/src/dlib/uri.cpp:192–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 }
191
192 void Decode(const char* src, char* dst)
193 {
194 size_t left = strlen(src);
195 while (left > 0) {
196 if (src[0] == '+') {
197 *dst = ' ';
198 src++;
199 left--;
200 }
201 else if (left > 2 && src[0] == '%' && isxdigit(src[1]) && isxdigit(src[2])) {
202 char tmp[3];
203 tmp[0] = src[1];
204 tmp[1] = src[2];
205 tmp[2] = '\0';
206 *dst = (char) strtoul(tmp, 0, 16);
207 src += 3;
208 left -= 3;
209 } else {
210 *dst = *src;
211 src++;
212 left--;
213 }
214 dst++;
215 }
216 *dst = '\0';
217 }
218
219 bool Compare(Parts* a, Parts* b)
220 {

Callers 1

TESTFunction · 0.50

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.40