Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
void QStoredDrag::setEncodedData( const QByteArray & encodedData )
{
    d->enc = encodedData.copy();
}