QString LineMessage = LineCommand->displayText(); QChar lettre ; int unicodevalue; QList listunicode_original ; QList listunicode ; QString entitai = "&#"; QString temporairestring; //QUrl urlmessage; for(i=0; i < LineMessage.size(); i++) { lettre = LineMessage.data()[i]; unicodevalue = lettre.unicode(); if ( unicodevalue > 127 ) { listunicode_original.append(lettre); temporairestring = QString::number(unicodevalue) ; entitai.append(temporairestring) ; entitai.append(";"); listunicode.append(entitai); entitai = "&#"; } } for ( i = 0; i < listunicode.size() ; i++ ) { LineMessage.replace(listunicode_original[i], listunicode[i]); }