OK, so your question is basically two questions in one. First, you need to be able to decode quoted-printable. I’m assuming that you have the encoded text as a string. You’ll have to run through this string with a while-loop, like below. I’ve deliberately left out the part where you turn the two hex characters into a byte; I’m sure you can figure this out for yourself :)
var i = 0;
var output = new List<byte>();
while (i < input.Length)
{
if (input[i] == '=' && input[i+1] == '\r' && input[i+2] == '\n')
{
// skip this
i += 3;
}
else if (input[i] == '=')
{
byte b = (construct the byte from the characters input[i+1] and input[i+2]);
output.Add(b);
i += 3;
}
else
{
output.Add((byte)input[i]);
i++;
}
}
At the end of this, output
contains the raw bytes. Now all you need to do is decode it using UTF8:
var outputString = Encoding.UTF8.GetString(output.ToArray());
If you have any questions, please ask in a comment. And remember: don’t copy and use code that you don’t understand :)