Originally Posted by
wysota
What if you convert to something that can accept non-ascii input instead of std::string which will cut the text at the first occurence of a null character? E.g. stay with
QString?
Hmm this?
QString html
= std
::move(output.
buffer);
QWebPage * tmp_webpage = new QWebPage();
tmp_webpage->mainFrame()->setHtml(html);
std::fstream test_stream;
test_stream.open("example14.html", std::ios::out | std::ios::in);
test_stream << tmp_webpage->mainFrame()->toHtml().toStdString(); //only toHtml is not enough
test_stream.close();
QString html = std::move(output.buffer);
QWebPage * tmp_webpage = new QWebPage();
tmp_webpage->mainFrame()->setHtml(html);
std::fstream test_stream;
test_stream.open("example14.html", std::ios::out | std::ios::in);
test_stream << tmp_webpage->mainFrame()->toHtml().toStdString(); //only toHtml is not enough
test_stream.close();
To copy to clipboard, switch view to plain text mode
These functions return the same ^^
But This
QString html
= std
::move(output.
buffer);
QWebPage * tmp_webpage = new QWebPage();
tmp_webpage->mainFrame()->setHtml(html);
std::fstream test_stream;
test_stream.open("example14.html", std::ios::out | std::ios::in);
test_stream << html.toStdString();// tmp_webpage->mainFrame()->toHtml().toStdString();
QString html = std::move(output.buffer);
QWebPage * tmp_webpage = new QWebPage();
tmp_webpage->mainFrame()->setHtml(html);
std::fstream test_stream;
test_stream.open("example14.html", std::ios::out | std::ios::in);
test_stream << html.toStdString();// tmp_webpage->mainFrame()->toHtml().toStdString();
To copy to clipboard, switch view to plain text mode
Returns good html... (to test_stream)
The HTML is CUT after
</script>
</script>
To copy to clipboard, switch view to plain text mode
and in append code is
</div></div></body></html>
</div></div></body></html>
To copy to clipboard, switch view to plain text mode
where in orginal code (HTML - after </script>) is
<table "class">....
<table "class">....
To copy to clipboard, switch view to plain text mode
And at the end:
std::cout << html.size() << " vs " << tmp_webpage.mainFrame()->toHtml().length();
std::cout << html.size() << " vs " << tmp_webpage.mainFrame()->toHtml().length();
To copy to clipboard, switch view to plain text mode
Returns: 13876 vs 8509 ... where is my html code?
Bookmarks