mirror of https://github.com/kiwix/libkiwix.git
parent
82d477009d
commit
aa2e443eb8
|
@ -269,15 +269,15 @@ std::string kiwix::urlDecode(const std::string& value, bool component)
|
||||||
int iHi = hexToInt(hi);
|
int iHi = hexToInt(hi);
|
||||||
int iLo = hexToInt(lo);
|
int iLo = hexToInt(lo);
|
||||||
if (iHi < 0 || iLo < 0) {
|
if (iHi < 0 || iLo < 0) {
|
||||||
// Invalid escape sequence
|
// Invalid escape sequence
|
||||||
os << '%' << hi << lo;
|
os << '%' << hi << lo;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
char c = (char)(iHi << 4 | iLo);
|
char c = (char)(iHi << 4 | iLo);
|
||||||
if (!component && isReservedUrlChar(c)) {
|
if (!component && isReservedUrlChar(c)) {
|
||||||
os << '%' << hi << lo;
|
os << '%' << hi << lo;
|
||||||
} else {
|
} else {
|
||||||
os << c;
|
os << c;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
os << *it;
|
os << *it;
|
||||||
|
|
Loading…
Reference in New Issue