Hello,

I'm having troubles trying to convert a iso-8859-1 QString to something better, like an utf-8 QString.

A QByteArray (data) contains some mail headers (From, To, Subject, ...), and is downloaded from a server with a QTcpSocket. So, here is the code :
Qt Code:
  1. //data = QByteArray, contains the mail headers
  2. liste_from = QString::fromLatin1(data.constData()).trimmed().split(' ');
To copy to clipboard, switch view to plain text mode 

Here I select the mail autor, the QString that I need to work with :
Qt Code:
  1. QString mail_autor = liste_from.operator[](1);
  2. std::cout << "AUTOR : \t\t" << mail_autor.toStdString() << std::endl;
To copy to clipboard, switch view to plain text mode 

Like mail is encoded in iso-8859-1 (RFC 2047), I get something like this :
Qt Code:
  1. =?iso-8859-1?Q?R=E9gis?=
To copy to clipboard, switch view to plain text mode 

But I need to convert it, perhaps in utf-8, to get something like this :
Qt Code:
  1. Régis
To copy to clipboard, switch view to plain text mode 

So I want to use some Qt functionalities, like QString::toUtf8() but nothing happens...
Qt Code:
  1. QString mail_autor = liste_from.operator[](1);
  2. QByteArray mail_autor_converted = mail_autor.toUtf8();
  3. std::cout << "AUTOR : \t\t" << mail_autor_converted.constData() << std::endl;
  4. // Display : =?iso-8859-1?Q?R=E9gis?=
To copy to clipboard, switch view to plain text mode 

I don't understand why the convertion isn't done.
Could you help me please ?