in reply to Encoding/charset Aware MIME Email Generation

I would assume that you will have to manually construct each MIME part and encode its body to the encoding you want. Encoding to utf8 (via encode('UTF-8', $payload)) and setting the appropriate Content-Encoding headers should work, because afterwards you only have an octet stream to deal with anymore.

Replies are listed 'Best First'.
Re^2: Encoding/charset Aware MIME Email Generation
by sapphirecat (Acolyte) on Jan 18, 2012 at 20:11 UTC

    Thanks. I will do that.

    Upon further reflection, I don't think I can get what I want. Since strings are always characters, no module can tell for certain what it should do with one containing sequences of code points that would be valid utf-8: those sequences can be either multiple latin-1 characters, or an individual character encoded as utf-8. Doing the right thing for knowledgeable users will probably mangle the data of everyone else even more.

    Does that sound like enlightenment, or confusion?

    "Basically, displaying invisible data is not maintainable."