Identity Encodings
The
7bit,
8bit, and
binary encoding values state that the body of the message hasn’t been encoded. In principle, there’s no need to process unencoded data at all. For convenience, the
encode() and
decode() functions of
RWMimeUtils accept the values
"7bit",
"8bit", and
"binary" as encoding types. When any of these three values is provided as an encoding type, both functions simply return the original string.
RWCString text = "Unencoded text”;
RWCString encoded = RWMimeUtils::encode(text,
RWMimeUtils::SevenBit);
assert(encoded == text); // Always true
Because unencoded values do not change the string provided, programs can safely call encode() and decode() with any MIME C-ontent‑Transfer‑Encoding value and receive the correct data.