MMS Body - Extracted but Unreadable
I have a problem reading the MMS body I have extracted using CPlainText. The platform is C++ on a Nokia 3650. Here is a snippet of my code:
CMsvEntrySelection* att = messageMmsMtm->GetAttachmentsL();
CPlainText* textAtt = CPlainText::NewL();
if(att->Count() > 0)
for(TInt i = 0; i < att->Count(); i++)
if(messageMmsMtm->AttachmentTypeL(att->At(i)) == MIMETxt)
messageMmsMtm->GetAttachmentPathL(att->At(i), fileName );
textAtt->ImportTextFileL( 0, fileName, CPlainText::EOrganiseByLine );
textAtt->Extract( buf, 0);
When I try to look at or work with the buf descriptor, all I get are box characters. The number of boxes equals (more or less) the size in bytes of the incoming MMS body, so I think I'm getting the right chunk.
I need to get a readable version of this body text into a TBuf descriptor in order to finish a 9 month project. I've tried converting it to/from/in/out of every conceivable format, but it's still useless.
Free pile of hurricane debris to the person providing the first workable answer!!
OK, I figured it out. The body text of the incoming MMS is a two byte binary numeric representation with the least significant byte first.
So.... after my code listed above, I added:
for(TInt j = 0; j < buf.Length(); j++)
bufOut now contains a workable version of the MMS body text.
What a stupid way to convert text. Anybody know a cleaner method?
I guess I get to keep my pile of debris...
i am not able to find variable "MIMETxt" which u have used, can u plz tell where it is located.
MIMETxt is a descriptor holding the standard MIME text string, as follows: