[Qt-interest] PHP's htmlentities in Qt
frgtn
me at frgtn.net
Thu Jul 23 21:26:02 CEST 2009
Don't know about html_entity_encocde/decode equivalents in Qt, but you
can use XML CDATA sections. You can put the text between <![CDATA[ <..>
]]> and contents will not be parsed by XML parser.
One downside of it is that you'll have to check for "]]>" sequence anyway.
Karol Krizka wrote:
> Hi there,
>
> I'm wondering if there is a function in Qt that is equivalent to PHP's
> htmlentities [1] and html_entity_decode [2]. One basically turns all
> special HTML characters into entities, and the other one reverses that.
>
> The reason I am asking this is that I'm trying to save an HTML document
> inside an XML file. The HTML document is some text and images that the
> user will create, and the XML file is a global settings file that will
> contain the said document. I need to encode the HTML special characters
> (<,>,&) into something that will make it possible for me to reread the
> entire document back from the XML file without any trouble.
>
> --
> Cheers,
> Karol Krizka
> http://www.krizka.net
>
> [1] http://ch2.php.net/manual/en/function.htmlentities.php
> [2] http://ch2.php.net/manual/en/function.html-entity-decode.php
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list