none
[E2007][cdoex]the subject and attach file name (has both japanese and korean characters) not show correctly RRS feed

  • Question

  • I am trying to backup/restore an email in the store. the email shows normal before I backup and restore. but the subject and attach file name cannot display correctly after I restore.

    exchange 2007 version: 08.01.0240.006

    win2008 server EE

    c++

    use the cdoex to backup and restore a message

    the code is like this:

    	CComPtr< IMessage > cdoexMessage;
    	CComPtr< IDataSource > cdoexDataSource;
     CComBSTR uid(account._uid.c_str()), pwd(account._pwd.c_str());
    	if (!SUCCEEDED(cdoexMessage.CoCreateInstance(__uuidof(Message))))
    		return false;
    
    	if(!SUCCEEDED(cdoexMessage->get_DataSource(&cdoexDataSource)))
    		return false;
    
    	if(!SUCCEEDED(cdoexDataSource->Open(href,
    									conn, 				adModeRead,									adFailIfNotExists,									adOpenSource,									uid,										pwd))
    		)
    
    	return false;
    
    CComPtr< _Stream > cdoStream;
    
    	if (!SUCCEEDED(cdoexBodyPart->GetStream(&cdoStream)))
    		return false;
    
     cdoStream->put_Type(adTypeBinary);
    
    	ADO_LONGPTR length = 0;
    	CComVariant partBin;
     cdoStream->get_Size(&length);
     cdoStream->Read(length, &partBin);
    
    
    

     

    the mail is created through owa. I input the subject as "لا_폴", the content is same "لا_폴", added an attach file named "لا_폴";

    after backup and restore, the content is correct (still shows "لا_폴"), but the subject and attach file name display ???.

    the issue seems to be when backup the subject is not saved correctly.

     

    X-MS-Has-Attach: yes
    Content-Class: urn:content-classes:message
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit
    Content-Type: multipart/mixed;
     boundary="----_=_NextPart_001_01CC4C03.9285AC99"
    Subject: =?utf-8?B?7Y+0642U?=
    Date: Wed, 27 Jul 2011 10:19:05 +0800

    .

    .

    .

    ------_=_NextPart_002_01CC4C03.9285AC99
    Content-Type: text/plain;
     charset="utf-8"
    Content-Transfer-Encoding: base64

    7Y+0642UDQo=

    ------_=_NextPart_002_01CC4C03.9285AC99

    My question is why the conent shows normal but the subject and attach file name altered?

    I appreciate your help.

     





    Wednesday, July 27, 2011 5:39 AM