Better urlencode compatibility

This commit is contained in:
fgenesis 2015-10-02 19:35:22 +02:00
parent 9227cc114a
commit f5a04dd9d4

View file

@ -272,7 +272,8 @@ void URLEncode(const std::string& s, std::string& enc)
{
const unsigned char c = s[i];
// from https://www.ietf.org/rfc/rfc1738.txt, page 3
if(isalnum(c) || c == '$' || c == '-' || c == '_' || c == '.' || c == '+' || c == '!' || c == '*' || c == '\'' || c == '(' || c == ')' || c == ',')
// with some changes for compatibility
if(isalnum(c) || c == '-' || c == '_' || c == '.' || c == ',')
enc += (char)c;
else if(c == ' ')
enc += '+';