These are chat archives for IndySockets/Indy
Indy website may have a few issues for short periods today. We are moving and updating it. However to get our SSL certificate and other things I have to first update the public DNS to get the processes started. We apologize for any inconvenience.
When ready, it will be at the same url http://www.IndyProject.org
for x := 0 to msg.MessageParts.Count-1 do begin part := msg.MessageParts[x]; if part.PartType = mptText then begin if IsHeaderMediaType(part.ContentType, 'text/html') then begin email.body := TIdText(part).Body.Text; end; if IsHeaderMediaType(part.ContentType, 'text/plain') then begin email.plain := TIdText(part).Body.Text; end; end; end;
part.CharSettells that is
UTF-8but it doesn't?
CharSetproperty holds whatever value the email has in the
charsetattribute of the
Content-Typeheader, Indy doesn't try to validate it. If the
charsetis wrong, the
Bodytext won't be read correctly
...Body.Textcause I got error message about encode
ISO-8859-1(or WINDOWS-1252.. etc) and include Body, I got no error, but all fields in the MSSQL have a wrong encode - you can see "??"... like that
Body.Textis correct before you put it into ZEOS/MSSQL?
RawUTF8- comes from mORMot, which is
type AnsiString(CP_UTF8)- and the same variable I'm using to set Parameters
that Body.Text is correct
Like what, save in a file?
stringbut Indy expects a UTF-16 encoded
string. Indy puts FPC into
AnsiString, which Lazarus then puts UTF-8 into, Indy does not put FPC into
putting it in a MessageBox, for instance
Bigger to use like that - but looks ok if I save... some examples
That makes things a bit harder, because Lazarus uses UTF-8 encoded string but Indy expects a UTF-16 encoded string
TIdText(part).Body.Textfrom ANSI to UTF8?
ShowMessage()show all good - so it is UTF-8