Assuming htmlContent is QString, you probably created it with wrong encoding. For example, if original HTML data (which is bytes) is UTF-8, then you should maybe use something like
QTextDocument needs very correct HTML to function correctly - WebKit / Firefox / QWebBrowser usually accepts less wellformed input and still displays it correctly.
Thus write the output into a file and send it to some HTML-checking program, fix all issues and then try again.
Assuming htmlContent is QString, you probably created it with wrong encoding. For example, if original HTML data (which is bytes) is UTF-8, then you should maybe use something like
htmlContent = QString::fromUtf8(myHtmlDataCharPtr);
If htmlContent is char pointer to UTF-8 data, then you should use
document->setHtml(QString::fromUtf8(htmlContent));