これです。もっと良い方法あると思うんですけどね。
BOOL URLdecode(char *in, char* out)
{
char hex[3] = { 0 };
char *p;
while (*in) {
if (*in != '%')
*out = *in;
else {
++in;
p = in;
if (*p >= '0' && *p <= '9' || *p >= 'a' && *p <= 'f' || *p >= 'A' && *p <= 'Z') {
hex[0] = *p;
++p;
if (*p >= '0' && *p <= '9' || *p >= 'a' && *p <= 'f' || *p >= 'A' && *p <= 'Z') {
hex[1] = *p;
*out = strtol(hex, &p, 16);
++in;
}
}
else
return FALSE;
}
++in;
++out;
}
*out = '\0';
return TRUE;
}