Habe ein kleines Problem mit QWindowsMime. Ich versuche einen Text nach "plain/text" zu wandeln:
Code: Alles auswählen
#include <qmime.h>
int main( int argc, char **argv )
{
const char *text1 = "Hallo text\n oder doch\r\n wer weiss?";
QWindowsMime::initialize();
QWindowsMime *mime = QWindowsMime::convertor (QWindowsMime:: cfToMime(1), 1 );
QString qstring(text1);
QCString qcstring = qstring.local8Bit();
QCString qcstring2 = mime->convertToMime(qcstring,"plain/text",1);
const char *text2 = qcstring2.data();
qDebug("text1: pos10: %x pos11: %x pos21: %x pos22: %x",
text1[0x0a], text1[0x0b], text1[0x15], text1[0x16]);
qDebug("text2: pos10: %x pos11: %x pos21: %x pos22: %x",
text2[0x0a], text2[0x0b], text2[0x15], text2[0x16]);
return 0;
}