Bug 51801

Summary: QWebView - eats xml header
Product: WebKit Reporter: szyk <szyk100>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   

Description szyk 2011-01-02 03:23:04 PST
I have xhtml document like this:
QString gHtmlDefHeader = QString::fromUtf8("<?xml version=\"1.0\" encoding=\"utf-8\"?>"
   "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
   "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"pl\">"
   "<head></head><body>");
QString gHtmlDefFooter = QString::fromUtf8("</body></html>");

I write it to QWebView with command:
ui->mOutput->setHtml(gHtmlDefHeader + stylesForOutputList() + gHtmlDefFooter);

And I read it with command:
ui->mOutput->page()->mainFrame()->toHtml()

And suprisingly result does not have:
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"

So my direct page dumps are broken due to lack info about encoding!!!
Comment 1 Alexey Proskuryakov 2011-01-02 12:42:50 PST
This is not a QWebView bug.

*** This bug has been marked as a duplicate of bug 25206 ***