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.
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:
Use the TMsvId aMessageId
parameter of the message
body text to get the CMsvEntry class.
Use the CMsvEntry::ReadStoreL() method to get the CMsvStore class.
Call theCMsvStore::RestoreBodyTextL() method that
takes CRichText& aRichTextBody
and TUint aCharsetOverride parameters.
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:
Use the TMsvId aMessageId
parameter of the message
body text to get the CMsvEntry class.
Use the CMsvEntry::ReadStoreL() function to get the CMsvStore class.
Call the CMsvStore::InitialisePlainBodyTextForReadL() function
to get the CMsvPlainBodyText
object.
Call the CMsvPlainBodyText::SetCharacterSetL()
function
with the new charset ID with which to retrieve the body text.
Call the CMsvPlainBodyText::NextChunkL()
function
or the CMsvPlainBodyText::PreviousChunkL()
function
to get the body text in chunks.