2014-08-01 9:40 GMT+02:00 <pulkomandy@xxxxxxxxxxxxx>: > - char hexString[] = { chunk[i + 1], chunk[i + 2], 0 }; > - result << (char)strtol(hexString, NULL, 16); > + bool isEncoded = false; > + char decoded = 0; > + > + if (chunk[i] == '%' && i < chunk.Length() - 2) > + { > + char hexString[] = { chunk[i + 1], chunk[i + > 2], 0 }; > + char* out = NULL; > + decoded = (char)strtol(hexString, &out, 16); > + if (out == hexString + 2) { > + isEncoded = true; > + i += 2; > + } > + } Style issue. This code wrongly accepts "%-1": I'd recommend using isxdigit() on chunk[i+1] and chunk[i+2]. Bye, Jérôme