Topic Path: Symbol Reference > Classes > TIdMessage Class > TIdMessage Properties > CharSet Property
TIdMessage.CharSet Property

Indicates the character set used for the message.

property CharSet: string;

CharSet is a String property that indicates the character set expected in message contents. CharSet can contains one of the official names for character sets as identified in IdCharsetNames

The up-to-date list of character set names and aliases can be found at: 

Internet Assigned Numbering Authority (IANA) Official Character Sets  

Character set information may also be supplied as an argument in the content type for individual items in the MessageParts collection. The value in CharSet will be updated using the content type argument value when message properties are read in ProcessHeaders

CharSet is used to populate the content type argument when message headers are updated in GenerateHeader

CharSet has been defined primarily for use with textual data. However, it is possible that non-textual data might also specify a charset value.

  IdMessage.Sender := '';
  IdMessage.From.Text := sOrgBy;
  IdMessage.Subject := '[CAL] ' + sEventType;
  IdMessage.Recipients.EmailAddresses := sAttendees;
  IdMessage.Priority := mpHigh;
  IdMessage.ContentType := 'text/plain';
  IdMessage.CharSet := 'US-ASCII';

  IdMessage.Body.Text :=
    'Event: '      + sEventType + EOL +
    'Date: '       + FormatDateTime('mm/dd/yyyy hh:nn', dtMeeting) +
    EOL +
    'Duration: '   + sDuration +
    EOL +
    'Location: '   + sLocation +
    EOL +
    'Organizer: '  + sOrgBy +
    EOL +
    'Attendees: '  + sAttendees +
    EOL + EOL +

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.