Whenever your encoded, binary string is used together with a text
string, Perl will assume that your binary string was encoded with
ISO-8859-1, also known as latin-1. If it wasn't latin-1, then your data
is unpleasantly converted. For example, if it was UTF-8, the individual
bytes of multibyte characters are seen as separate characters, and then
again converted to UTF-8. Such double encoding can be compared to
double HTML encoding (">"), or double URI encoding (%253E).
This silent implicit decoding is known as "upgrading". That may sound
positive, but it's best to avoid it.
My
utf8message bodies were being mangled until I ranutf8::decode($text_body)andutf8::decode($html_body)before passing the bodies in toEmail::Stuffer->new({...}). Perhaps the documentation could mention this? I found the idea for this in theutf8(3perl)man page and the reason for the need in thePERLUNIFAQ(1)man page:What if I don't decode?