delphi - Indy IMAPClient UIDRetrieveAllEnvelopes not getting other character set properly -
using: delphi xe2, windows 8 us-english default language
i writing email client delphi. i'm using tidimap4 connect gmail mailbox via imap , getting message list this:
var messagelist: tidmessagecollection; begin imapclnt.selectmailbox('inbox'); imapclnt.uidretrieveallenvelopes(imapclnt.messagelist);
then i'm retrieving message subjects this:
var idmsg: tidmessage; s: string begin c := 0 fimapclnt.messagelist.count - 1 begin idmsg := fimapclnt.messagelist[c]; s := idmsg.subject;
however, if message subject in different language (say, hebrew) message subjects not displayed (see attached image) on computer hebrew set default windows language.
how can correct code ensure works properly, retrieving language in correct unicode characters?
screen capture:
tia.
the email headers in screenshot have been encoded per rfc 2047 ("mime part three: message header extensions non-ascii text"). tidimap4.uidretrieveallenvelopes()
captures , stores raw data , not automatically decode it. can use various decode...()
functions in idcoderheaader.pas
unit decode headers manually, eg:
uses ..., idcoderheader; var idmsg: tidmessage; s: string begin ... c := 0 fimapclnt.messagelist.count - 1 begin idmsg := fimapclnt.messagelist[c]; idmsg.subject := decodeheader(idmsg.subject); decodeaddresses(idmsg.fromlist); decodeaddress(idmsg.sender); decodeaddresses(idmsg.replyto); decodeaddresses(idmsg.recipients); decodeaddresses(idmsg.cclist); decodeaddresses(idmsg.bcclist); ... end; ... end;
Comments
Post a Comment