Merge pull request #942 from xiaoyifang/fix/website-encoding

fix: website encoding problem
This commit is contained in:
xiaoyifang 2023-07-08 20:07:12 +08:00 committed by GitHub
commit 23bc1422e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,12 +92,7 @@ void IframeSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob)
buffer->setData(articleString.toUtf8()); buffer->setData(articleString.toUtf8());
//"text/html;charset=utf-8" will be treated as text/plain in Linux . requestJob->reply( "text/html; charset=utf-8", buffer );
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
requestJob->reply( contentType, buffer );
#else
requestJob->reply( "text/html", buffer );
#endif
}; };
connect( reply, &QNetworkReply::finished, requestJob, finishAction ); connect( reply, &QNetworkReply::finished, requestJob, finishAction );