VMime
|
Public Types | |
enum | Encoding { ENCODING_AUTO, ENCODING_QP, ENCODING_B64 } |
Public Member Functions | |
wordEncoder (const string &buffer, const charset &charset, const Encoding encoding=ENCODING_AUTO) | |
const string | getNextChunk (const size_t maxLength) |
Encoding | getEncoding () const |
Static Public Member Functions | |
static bool | isEncodingNeeded (const generationContext &ctx, const string &buffer, const charset &charset, const string &lang) |
static Encoding | guessBestEncoding (const string &buffer, const charset &charset) |
Encodes words following RFC-2047.
enum Encoding |
wordEncoder | ( | const string & | buffer, |
const charset & | charset, | ||
const Encoding | encoding = ENCODING_AUTO |
||
) |
wordEncoder::Encoding getEncoding | ( | ) | const |
Return the encoding used.
Return the next chunk in the word.
maxLength | maximal length of the chunk |
References charsetConverter::create(), wordEncoder::ENCODING_B64, vmime::lineLengthLimits::max, qpEncoder::RFC2047_getEncodedLength(), and vmime::charsets::UTF_8.
|
static |
Guess the best RFC-2047 encoding to use for the specified buffer.
buffer | buffer to analyze |
charset | charset of the buffer |
References stringUtils::countASCIIchars(), charset::getRecommendedEncoding(), and vmime::encodingTypes::QUOTED_PRINTABLE.
Referenced by wordEncoder::wordEncoder().
|
static |
Test whether RFC-2047 encoding is needed.
ctx | generation context |
buffer | buffer to analyze |
charset | charset of the buffer |
lang | language code, in the format specified by RFC-1766 |
References stringUtils::findFirstNonASCIIchar(), context::getInternationalizedEmailSupport(), charset::getRecommendedEncoding(), and vmime::npos.