MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Http_UrlEncode

Function Http_UrlEncode

src/_HttpBase.h:364–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364void Http_UrlEncode(cc_string* dst, const cc_uint8* data, int len) {
365 int i;
366 for (i = 0; i < len; i++) {
367 cc_uint8 c = data[i];
368
369 if (Http_UrlDirect(c)) {
370 String_Append(dst, c);
371 } else {
372 String_Append(dst, '%');
373 String_AppendHex(dst, c);
374 }
375 }
376}
377
378void Http_UrlEncodeUtf8(cc_string* dst, const cc_string* src) {
379 cc_uint8 data[4];

Callers 2

HttpUrl_EncodeUrlFunction · 0.85
Http_UrlEncodeUtf8Function · 0.85

Calls 3

Http_UrlDirectFunction · 0.85
String_AppendFunction · 0.85
String_AppendHexFunction · 0.85

Tested by

no test coverage detected