I could use some help reading email with special characters in it and outputting that email with the characters.
So far I have witnessed email come in with the character sets: "UTF-8", "windows-1252", "ISO-8859-1"
I have seen
‘hey’
represented as
=91hey=92
and
‘’,“”=hey÷½Öñ♦→%@¥÷
represented as
=E2=80=98=E2=80=99,=E2=80=9C=E2=80=9D=3Dhey=C3=B7=C2=BD=C3=96=C3=B1=E2=99=A6=E2=86=92%@=C2=A5=C3=B7
(I removed two =
signs above because of line breaks)
sometimes these seem to be hex representations because I can put them into binascii.unhexlify()
and get the proper result back.
there were a few others where if I dropped the =
and put \x
and ran it through "myString".decode('iso-8859-1')
I got the right thing.
I'm pretty confused, how do I decode the email text?