Overriding the Charset when Reading Email Message Data

This tutorial explains how to override the charset when reading email message data.

If the email message is stored in 8-bit format, the email application can retrieve the data stored using a new charset that is set by it.

Procedure

Messages stored as rich text

For retrieving the message body text that has been stored in 8-bit and rich text format with a new character set using the RestoreBodyTextL() function, complete the following steps:

  1. Use the TMsvId aMessageId parameter of the message body text to get the CMsvEntry class.

  2. Use the CMsvEntry::ReadStoreL() method to get the CMsvStore class.

  3. Call the CMsvStore::RestoreBodyTextL() method that takes CRichText& aRichTextBody and TUint aCharsetOverride parameters.

  4. Pass the new charset, with which to retrieve the body text as TUint aCharsetOverride parameter.

Messages stored as plain text

For retrieving the message body text that has been stored in 8-bit and plain text format with a new character set using the RestoreBodyTextL() function, complete the following steps:

  1. Use the TMsvId aMessageId parameter of the message body text to get the CMsvEntry class.

  2. Use the CMsvEntry::ReadStoreL() function to get the CMsvStore class.

  3. Call the CMsvStore::InitialisePlainBodyTextForReadL() function to get the CMsvPlainBodyText object.

  4. Call the CMsvPlainBodyText::SetCharacterSetL() function with the new charset ID with which to retrieve the body text.

  5. Call the CMsvPlainBodyText::NextChunkL() function or the CMsvPlainBodyText::PreviousChunkL() function to get the body text in chunks.