Board index » delphi » UTF-8 in the subject

UTF-8 in the subject


2005-03-18 05:14:06 AM
delphi187
I am using idpop3 and idmessage [indy 10] and I occassionally get a message
with a subject like the following
=?utf-8?B?QUNIIFBheW1lbnQgTm90aWZpY2F0aW9u?=
when I save the message to file and open in outlook the subject is ACH
Payment Notification
What do I have to do to convert this so that I can read it? Thanks
 
 

Re:UTF-8 in the subject

"Daniel Manchester" <XXXX@XXXXX.COM>writes
Quote
I am using idpop3 and idmessage [indy 10] and I occassionally
get a message with a subject like the following
That is using UTF-8 encoding. Indy does not currently support UTF-8 in
encoded header values.
Quote
What do I have to do to convert this so that I can read it?
Parse it manually. The 'B' between the second and third '?' characters
specifies that the data is encoded in base64. Everything between the third
and fourth '?' characters are the actual data. If you are using D6+, the
VCL has functions for decoding UTF-8 strings, and Indy has functions for
decoding base64. So you would first decode the base64 to get the UTF-8, and
then decode that into the original string.
Gambit