Re: Reading message bodies with charset="utf-8"

Giganews Newsgroups
Subject: Re: Reading message bodies with charset="utf-8"
Posted by:  Nick Sivo (junk6indyforu…
Date: Tue, 29 Aug 2006

Further news--

Even saving the message to a stream using msg.SaveToStream() mangles the UTF-8 characters.  Perhaps the damage has been done by the time msg has been populated?


> Hello,
> I'm attempting to use Indy Pop3 to retrieve and process some email messages
> with the following properties:
> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> I'm using C#, .NET 2.0 and VS 2005 on x86.
> After declaring msg as
>  Indy.Sockets.Message msg = new Indy.Sockets.Message();
> and populaitng msg successfully by calling
>  iPOP3.Retrieve(1, msg);
> I am unable to access the message body.  The msg.Body.Text property mangles
> the UTF-8 text, and both msg.Body.SaveToStream() and msg.Body.SaveToFile() a
> re unimplemented.  I tried searching msg.MessageParts, but since the message
>  is not mime encoded, there are no parts (msg.MessageParts.Count = 0).  In a
> n unsuccessful act of desperation I tried treating each character in msg.Bod
> y.Text as a byte and parsing the resulting byte array, but it too was invali
> d.
> Is there a way to get the raw bytes of the body so I can properly parse them
> ?
> Thanks for your time,
> Sincerely,
> Nick Sivo



In response to

Reading message bodies with charset="utf-8" posted by Nick Sivo on Tue, 29 Aug 2006