0

I have text were I see things such as '=E2=80=93', which appears to be referring to an en dash for example. I have tried looking at multiple possible solutions but have not found one that decodes things like this. Any help?

I am using email.message_from_file to parse eml files.

formicaman
  • 1,317
  • 3
  • 16
  • 32
  • Is the text completely composed of only those kinds of equals-and-two-hex-char segments? Or are they interspersed among regular text? – Kevin Jan 09 '20 at 13:28
  • It's interspersed. For example, a sentence could be "The weather is very nice today=E2=80=A2it is very sunny." – formicaman Jan 09 '20 at 13:38
  • You are looking at quoted-printable encoding. The `email` package should decode these transparently if the messages are well-formed. However, it's not entirely uncommon for email messages to be sent by flawed software written by junior PHP developers. – tripleee Jan 09 '20 at 14:36

0 Answers0