Search code examples
c#emailencodingdecodingquoted-printable

What type of encoding is being used?


I am currently making a program in which one of its functions is to extract the HTML part of a Multipart email.

I have accomplished that task fine however there is a type of encoding on some of the characters that I can't seem to figure out e.g.

',' into '=2C'
';' into '=3B'
'=' into '=3D'

and it also puts random '=' all over the place.

Does anyone know if there is a decoder for this (or even what the name of it is)? I have replaced a few things with code, however there are probably plenty more that I am missing because I haven't come across them yet. Thus, I would like to either figure out the type of encoding so I can replace everything, or find a library which has already done so.

P.s. I am sending the email from a hotmail account, if that might be the reason.


Solution

  • This is called quoted-printable encoding.

    Unfortunately, the existing QuotedPrintableStream from Microsoft is internal so that you cannot use it. However, you could take the one of the Mono project, or of any library dealing with MIME handling.