Logo Search packages:      
Sourcecode: qmf version File versions  Download package

QByteArray QMailCodec::encode ( const QString &  input,
const QString &  charset = "UTF-8" 
) [inherited]

Returns a QByteArray containing the string input, encoded to the text encoding charset and then to a sequence of 7-bit ASCII characters.

See also:

Definition at line 300 of file qmailcodec.cpp.

References QMailCodec::encode().

    QByteArray result;
        QDataStream out(&result, QIODevice::WriteOnly);

        // We can't currently guarantee that this is safe - we should investigate modifying
        // QTextStream to support a read-only interface...
        QTextStream in(const_cast<QString*>(&input), QIODevice::ReadOnly);

        encode(out, in, charset);

    return result;

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index