Encoding/decoding a string to URL and HTML
Are there any methods in Qt allowing programmer to easily encode/decode a string to URL and HTML?
Examples of what I need:
URL encoding:
"abc def" → "abc%20def"
URL decoding:
"abc%20def" → "abc def"
HTML encoding:
"A&B&C" → "A&B&C"
HTML decoding:
"A&B&C" → "A&B&C"
Of course these are trivial examples. I need full support for URL and HTML standards.
It seems HTML can be en/decoded using a QTextEdit::plainText and QTextEdit::html. But this requires QtGui and is not a nice solution at all.
Re: Encoding/decoding a string to URL and HTML
QUrl reference (it's in core)
Re: Encoding/decoding a string to URL and HTML
Thanks. I just have found this.
And what about the HTML encoding?
Re: Encoding/decoding a string to URL and HTML
As far as i know that is in Gui module.
Re: Encoding/decoding a string to URL and HTML
HTML encoding can be done with QTextDocument. Yet it's still QtGui.