从电子邮件消息文件创建pst时,Redemption API是否支持unicode字符?

时间:2018-03-20 05:17:12

标签: outlook-redemption

我的电子邮件文件中包含unicode字符。当我为该消息文件创建一个pst并将其加载到outlook中时,正文文本完全丢失。 从电子邮件消息文件创建pst时,兑换api是否支持unicode字符?

更新1

以下是创建PST的代码

        private static void CreatePSTUsingRedemption(XmlNodeList nodelist, string pstPath)
        {            
          RDOSession pstSession = null;
          RDOPstStore store = null;
          RDOFolder folder = null;
          RDOMail rdo_Mail = null;
          RDOItems items = null;
          string processingFileId = string.Empty;
          SafeMailItem sitem = new SafeMailItem();
          try
          {
              pstSession = new RDOSession();
              store = pstSession.LogonPstStore(pstPath, 1, Path.GetFileNameWithoutExtension(pstPath));
              int completedCount = 0;
              folder = store.IPMRootFolder;
              RDOFolder inboxFolder = pstSession.GetDefaultFolder(rdoDefaultFolders.olFolderInbox);
              inboxFolder.Delete();
              RDOFolder sentFolder = pstSession.GetDefaultFolder(rdoDefaultFolders.olFolderSentMail);
              sentFolder.Delete();
              RDOFolder outboxFolder = pstSession.GetDefaultFolder(rdoDefaultFolders.olFolderOutbox);
              outboxFolder.Delete();
              folder = folder.Folders.Add("Messages");
              foreach (XmlNode node in nodelist)
              {
                  processingFileId = node["Id"].InnerText;
                  RemoteSharedInfo rI = XmlUtil.GetObjectFromXmlString<RemoteSharedInfo>(node["RemoteSharedInfo"].OuterXml);
                  using (FileShareImpersonator imp = new FileShareImpersonator(rI))
                  {
                      imp.Start();
                      if (node["OriginalFileExtension"].InnerText.ToLower() == "eml" || node["OriginalFileExtension"].InnerText.ToLower() == "emlx")
                       {
                          items = folder.Items;
                          rdo_Mail = items.Add("IPM.Note");
                          sitem.Item = items.Add(0);
                          sitem.Import(node["FullPath"].InnerText, 0x400);
                          sitem.CopyTo(rdo_Mail);
                          rdo_Mail.Save();
                          store.Save();
                          completedCount++;
                          Console.WriteLine("FILES_PROCESSED:" + completedCount);
                      }
                      else //go to this ELSE block for email message files i.e for msg extension
                      {
                          rdo_Mail = pstSession.GetMessageFromMsgFile(node["FullPath"].InnerText);
                          rdo_Mail.CopyTo(folder);
                          rdo_Mail.Save();
                          store.Save();
                          completedCount++;
                          Console.WriteLine("FILES_PROCESSED:" + completedCount);
                      }
                  }
              }
          }
        catch (Exception ex)
        {
            Console.Error.WriteLine("Error:" + ex.Message);
            Environment.ExitCode = 1;
        }
        finally
        {
            Marshal.ReleaseComObject(rdo_Mail);
            Marshal.ReleaseComObject(folder);
            Marshal.ReleaseComObject(store);
            Marshal.ReleaseComObject(sitem);
            if (items != null)
                Marshal.ReleaseComObject(items);
        }
        pstSession.Logoff();
        Marshal.ReleaseComObject(pstSession);
        GC.Collect();
        Environment.ExitCode = 1;
    }

1 个答案:

答案 0 :(得分:1)

是,Redemption完全支持Unicode。让你的父亲创建一个Unicode PST文件。

创建PST文件的代码是什么? Outlook的确切版本是什么?