This is by design. When the ContentType property ContentType set, the property installer can update the CharSet property with a CharSet value if the input does not explicitly indicate the encoding. Certain types of content, especially in the text/ field, have certain default character set values ββdefined in different RFCs. Indie is trying to follow these rules as best as possible. Thus, you need to set the CharSet property CharSet desired value after you set the ContentType property, as you have already discovered:
//LMsg.CharSet := 'UTF-8'; LMsg.ContentType := 'text/plain'; LMsg.CharSet := 'UTF-8';
You can also do this instead:
LMsg.ContentType := 'text/plain; charset=UTF-8';
UPDATE : as of July 23, 2019, ContentType property ContentType now retain the corresponding value of the CharSet property if it is already set and the character set is not specified in the new ContentType value. Thus, the order in which the ContentType + CharSet paired properties ContentType CharSet is no longer a problem.
Remy Lebeau
source share