This project is read-only.

message.htmldata returns junk characters

Nov 4, 2009 at 8:39 PM

Hi,

I have a message with html data. When i try to retreive from message.htmlData it returns junks characters.

Original Message: Sorry, I wasn’t here Monday.

Modified Message: Sorry, I wasn=92t here Monday.

It also converts double quote to =93 and =94

and a single dash "-" to =96.

Is there a way to fix this?

 

Feb 2, 2010 at 3:37 PM

I just fixed this through help in MSDN Forums. Send your content to

 

        public string DecodeQuotedPrintable(string encoded)
        {
            byte[] buffer = new byte[1];
            return Regex.Replace(encoded, "=(\r\n?|\n)|=([A-F0-9]{2})", delegate(Match m)
            {
                if (byte.TryParse(m.Groups[2].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out buffer[0]))
                {
                    return Encoding.ASCII.GetString(buffer);
                }
                else
                {
                    return string.Empty;
                }
            });
        }

HTH