Encode a HTML Content to UTF-8 in QT, bleow this is the code but somthing it's not working.



  • The problem is that i take a HTML Content from a Webseit and the problems is that the German "Umlats" dosen't appeare properly do i miss somthing here.

        QByteArray bytes= reply->readAll();
        QString data(bytes);
        //qDebug()<<data;
        QJsonDocument d = QJsonDocument::fromJson(data.toUtf8());
        QJsonObject sett2 = d.object();
        QJsonValue value = sett2.value(QString("status"));
        //qWarning() << value;
        QString status(value.toString());
    

    .
    .
    .
    .
    .
    .
    .
    .
    ..


  • Lifetime Qt Champion

    Hi,

    You should share an example of the data you are downloading so that can be tested properly


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.