bug fixed in the encoder part of ghttp api

This commit is contained in:
mrmrfan 2018-09-28 10:52:30 +08:00
parent 4bc1fce9cf
commit 4e5dd9a184
3 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ static const std::string UrlEncode(const std::string& s)
ret += ptr[i];
else if(int(ptr[i])==32)
ret += '+';
else
else if((int(ptr[i])!=10) && (int(ptr[i])!=11) && (int(ptr[i])!=13))
{
char buf[5];
memset(buf,0,5);

View File

@ -31,7 +31,7 @@ class GstoreConnector {
$ret .= $c;
else if (ord($c)==32)
$ret .= "+";
else
else if (ord($c)!=10 and ord($c)!=11 and ord($c)!=13)
$ret .= sprintf("%%%X", ord($c));
}
return $ret;

View File

@ -31,7 +31,7 @@ class GstoreConnector:
ret += c
elif ((ord(c)>=97) and (ord(c)<=122)):
ret += c
else:
elif ((ord(c)!=10) and (ord(c)!=11) and (ord(c)!=13)):
ret += "{}{:X}".format("%", ord(c))
return ret