[Interest] How to add tidy using Qt?

程梁 devbean at outlook.com
Thu Dec 27 06:51:48 CET 2012


Hi, there! I want to add tidy as library into Qt program where I use some code as following:

const char* html = webView->page()->mainFrame()->toHtml().toUtf8().constData();
// ...
TidyBuffer output;
Bool ok = tidyOptSetBool(tdoc, TidyXmlOut, yes);
tidySetCharEncoding(tdoc, "utf8");
tidySaveBuffer(tdoc, &output);
QByteArray ret = QByteArray(reinterpret_cast<char*>(output.bp),output.size);

But I got warning: 

UTF-8 decoding error of 1 bytes : 0xff  = U+0255lx
UTF-8 decoding error of 1 bytes : 0xff  = U+0255lx
UTF-8 decoding error of 1 bytes : 0xe8  = U+0008lx
UTF-8 decoding error of 1 bytes : 0xe8  = U+0008lx
UTF-8 decoding error of 1 bytes : 0xfd  = U+0001lx
UTF-8 decoding error of 1 bytes : 0xfd  = U+0001lx
UTF-8 decoding error of 1 bytes : 0xfd  = U+0001lx
UTF-8 decoding error of 1 bytes : 0xfd  = U+0001lx
I've no idea how this happen. Could you help me? Thank you!

Cheng Liang
Nanjing, China
http://www.devbean.info 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121227/1ea9b009/attachment.html>


More information about the Interest mailing list