decode('latin ''aabfrom email message import message message( set_payload( ' \xe 'charset='latin ' as_string(print(tmime-version content-typetext/plaincharset="latin content-transfer-encodingbase or 'latin- 'see ahead qerc get_content_charset('latin notice how email automatically applies base mime encoding to non-ascii text parts on generationto conform to email standards the same is true for the more specific mime text subclass of messagefrom email mime text import mimetext mimetext( ' \xe '_charset='latin ' as_string(print(tcontent-typetext/plaincharset="latin mime-version content-transfer-encodingbase qerc get_content_charset('latin nowif we parse this message' text string with emailwe get back new message whose text payload is the base mime-encoded text used to represent the non-ascii unicode string requesting mime decoding for the payload with decode= returns the byte string we originally attachedfrom email parser import parser parser(parsestr(tq get_content_type('text/plainq _payload 'qerc\nq get_payload('qerc\nq get_payload(decode= ' \xe bhoweverrunning unicode decoding on this byte string to convert to text fails if we attempt to use the platform default on windows (utf to be more accurateand client-side scripting