I have the following example:
%3ca href%3d%22http://google.com%22%3eGoogle%3c/a%3e
When unescaped I expect this to be:
<a href="http://google.com">Google</a>
I've tried:
strUnescaped = QString::fromUtf8(strEncoded.toLatin1().data());
But the result is the same as the original unaffected and unmodified. What do I need to do?
You might use QUrl::fromPercentEncoding
to decode percent to regular character:
QString encodedStr = "%3ca href='http://google.com'%3eGoogle%3c/a%3e";
auto decodedStr = QUrl::fromPercentEncoding(encodedStr.toLatin1());
// decodedStr == "<a href='http://google.com'>Google</a>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With