Skip to content

Instantly share code, notes, and snippets.

View alanedwardes's full-sized avatar
👋

Alan Edwardes alanedwardes

👋
View GitHub Profile
@alanedwardes
alanedwardes / stringurlencode.c
Created March 14, 2014 00:13
Very simple C method to perform URL encoding on a char buffer. Includes a quick and dity list of characters to exclude. Some compilers will prefer sprintf_s or otherwise.
// ae - takes URL, puts percents in it.
void encodeUrl(char *out, int outSize, char *in, int inSize)
{
// Terminate our buffer
out[0] = '\0';
// Loop the input
for (int i = 0; i < inSize; i++)
{
// Get a char out of it