adding application controll

This commit is contained in:
jakani24
2024-05-10 11:24:44 +02:00
parent 7f0cb49f0a
commit ea13c6dc6a
34 changed files with 930 additions and 244 deletions

View File

@@ -147,13 +147,15 @@ std::string url_encode(const std::string& input) {
static const char* const safe_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~";
std::string encoded;
for (char c : input) {
if (std::strchr(safe_chars, c) != nullptr) {
encoded += c;
}
else {
char temp[4];
sprintf(temp, "%%%02X", (unsigned char)c);
encoded += temp;
if (c != '\0') {
if (std::strchr(safe_chars, c) != nullptr) {
encoded += c;
}
else {
char temp[4];
sprintf(temp, "%%%02X", (unsigned char)c);
encoded += temp;
}
}
}
return encoded;