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: enter image description here

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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -