I have Qt5 (5.7) and I'am facing a strange issue. I was unable to transform a std::string (output of a tested algorithm) to QString by following simple methods.
Does anybody have an idea ?
here are simple examples I have tested (none of these lines work...). each time the Visual studio watcher gave me the unknow character for accentuated letters.
std::string l_s = "&é'(-è_çà)=";
QString l = QString::fromUtf8(l_s.data(), l_s.size());
QString lll = QString::fromStdString(l_s);
QByteArray l_ba = QString::fromStdString(l_s).toUtf8();
QString l_t = "&é'(-è_çà)=";
std::string res = l_t.toStdString(); // here I lost information
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
QString ss = codec->toUnicode(l_s.c_str());
&Ú'(-Þ_þÓ)=? This solution may work for you: stackoverflow.com/questions/15531105/…