Search code examples
outlook-redemption

Do Redemption API support unicode characters when creating pst from email message files?


I have an email messages file having unicode characters in the body. When I created a pst for that message file and loaded it in outlook, body text is entirely missing. Do redemption api supports unicode characters when creating pst from email message file?

UPDATE 1

Below is the code for creating 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;
    }

Solution

  • Yes, Redemption is fully Unicode enabled. Make sire you are creating a Unicode PST file.

    What is your code creating the PST file? What is the exact version f Outlook?