BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Indy 10 Imap4 umlauts

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Michael Brednich
Guest





PostPosted: Fri Jan 14, 2005 8:43 am    Post subject: Indy 10 Imap4 umlauts Reply with quote



First of all: Please forgive me, I'm not using delphi. However, this
seems to be the right place to ask a question about indy.

When I'm using the IMAP4.Retrieve() method (Indy 10) to retrieve the
body of
a message that contains german umlauts (ö,ä,ü, ...) the returned body
does
eventually not contain the umlaut characters. Instead those characters
are set to '?'.

I've als retrieved the message as raw encoded data. In this data the
umlauts are encoded like this: =C4 or =E4.

OK, I can decode this myself, but it would be much more convinient if
the message class would provide a method to do so. Does anyone know if
there is such a method?

Here's my code (C#):

// create IMAP4 object
IMAP4 imap;
imap = new IMAP4();

// connect to server
imap.AuthType = IMAP4AuthenticationType.atUserPass;
imap.Host = ...
imap.Username = ...
imap.Password = ...
imap.Connect(true);

// open inbox and retrieve message headers
imap.RetrieveOnSelect = RetrieveOnSelect.rsHeaders;
if (imap.SelectMailBox("INBOX"))
{
if (imap.MailBox.MessageList.Count > 0)
{
Message msg = imap.MailBox.MessageList[0];

// retrieve first message (in decoded format)
msg.NoDecode = false;
if (imap.Retrieve(1, msg))
{
// get body
StringCollection body = null;

if (msg.ContentType.IndexOf("multipart") == -1)
{
body = msg.Body;
}
else
{
body = new StringCollection();

foreach(MessagePart mp in msg.MessageParts)
{
if (mp is Text)
{
Text t = (Text)mp;
for (int k = 0; k < t.Body.Count; ++k)
{
body.Add(t.Body[k]);
}
}
}
}
}
}
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.