Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: Sending a SMTP message with UTF-8 subject

www.cryer.info
Managed Newsgroup Archive

Re: Sending a SMTP message with UTF-8 subject

Subject:Re: Sending a SMTP message with UTF-8 subject
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 27 Nov 2007 14:05:19

"Richard" <ritchie872@yahoo.com> wrote in message
news:474c83cd$1@newsgroups.borland.com...

> My app is completly unicode and runs only on NT based systems.

Unicode does not provide a way to specify the codepage for individual
characters or substrings.

> A typical example of various languages in one line: using some e-mail
> program
> in russian, when you reply, the subject will be "Reply to: original
> subject". Reply
> to will be written by the program in russian, and if the original subject
> was in
> greek, here we go, now you have 2 charsets (talking in Ansi ) in one line.

From an email stand-point, there can be multiple encoding per line.  The
MIME standard provides for that.  The email program is merely encoding
"Reply to" and "original subject" separately, and can then concatentate the
two encoded values together since they are in the same codepage (as per the
MIME spec).  The receiver of the encoded email will decode the two values
individually and display them separately, since you can't have two codepages
active in the same UI control.

> Normal e-mail programs like The-bat. OE, etc will just encode this as
> UTF-8, which I am trying to do with Indy.

Which I've already explained to you how to do.

> I had the same problem with the name of the attachments

That is a completely different issue.  Indy does not encode the headers of
items in the MesssageParts collection at all, only the main headers of the
TIdMessage itself.  You are solely responsible for the formatting of the
MessagePart headers.

> that will only acept AnsiStrings as the FileName header

Everything in Indy is AnsiString when used under Win32.

> BTW,does HeaderEncoding = '8'  means to use 8bit (no encoding?).

Yes.

> I know that the values can be 'B' and 'Q' but did not know about the 8.

'B' and 'Q' are the only two encodings outlined in the MIME spec.  '8' is
not a commonly used encoding, but it does exist, and so Indy can skip
encoding when '8' is used since AnsiString can hold 8-bit characters.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive