QByteArray MIMECodec::decode(const QByteArray &buf, const char *encoding) { QCString enc(encoding); enc = enc.lower(); QByteArray outbuf = QCString("unknown encoding"); if (enc == "7bit" || enc == "8bit" || enc == "none" || enc == "binary") outbuf = buf.copy(); if (enc == "quoted-printable") outbuf = MIMECodec::decodeQuotedPrintable(QCString(buf)); if (enc == "base64") outbuf = MIMECodec::decodeBase64(buf); return outbuf; }
QByteArray MIMECodec::encode(const QByteArray &buf, const char *encoding, bool footer) { QCString enc(encoding); enc = enc.lower(); QByteArray outbuf; if (enc == "7bit" || enc == "8bit" || enc == "none" || enc == "binary") outbuf = buf.copy(); if (enc == "quoted-printable") outbuf = MIMECodec::encodeQuotedPrintable(QCString(buf), false, footer); if (enc == "quoted-printable-compat") outbuf = MIMECodec::encodeQuotedPrintable(QCString(buf), true, footer); if (enc == "base64") outbuf = MIMECodec::encodeBase64(buf); return outbuf; }
void QStoredDrag::setEncodedData( const QByteArray & encodedData ) { d->enc = encodedData.copy(); }