Format string qt html charset

2

I have the following string: QString str="Macarr & # x & 3; the integral. (I put space between all characters of the special character if it would not be visible and would appear A with the uncle "ã")

and wanted to format it so that it looks like this: QString str="Integral pasta. \ NWhite pasta. \ N"

I do not know the formatting / charset of this string, but I wanted to be able to pick up and transform all the special characters of it into the first word "#" and "#" and leave it correctly and if possible change all tags html (in case this
) for a \ n, for example ...

How can I do this?

    
asked by anonymous 11.11.2015 / 00:40

1 answer

2

There is no specific method in Qt to decode entities, but a contour is to use

QTextDocument *texto= new QTextDocument();
texto->setHtml( "Macarr&#xe3;o integral<br>" );

and get "converted" with

texto->getPlainText();
    
11.11.2015 / 01:53