We are currently working on an application that involves converting the .msg files to .eml files using Redemption 6.3. However, we have encountered an issue specifically with Japanese .msg files that use ISO-2022-JP as the character encoding. The problem lies in the incorrect encoding during the conversion process, leading to improperly displayed fields in the resulting .eml files.
For example, when I open the .msg and then the converted .eml in Outlook, pls notice how the sender’s name is wrongly displayed.
Difference between .msg and .eml
Looking at the converted .eml internally, we can see the encoded sender name and it clearly looks wrong:
wrongly encoded sender name
Due to this, our application portal displays this field improperly:
sender name on our portal
Even after trying various options, including different parameters for the RDOMailSaveAs()
method and exploring other Redemption APIs, we have not been able to resolve the ISO-2022-JP encoding issue.
Here’s the code snippet we are using for the conversion:
RDOSession session = getRDOSessionForCurrentThread();
try
{
using (SafeRDOMail message = new SafeRDOMail(session.GetMessageFromMsgFile(msgFilePath)))
{
message.RDOMail.SaveAs(emlFilePath, rdoSaveAsType.olRFC822_Redemption);
}
}
catch (Exception ex)
{
throw new Exception(String.Format("Error converting {0} to eml file.", emlFilePath), ex);
}
We would greatly appreciate any insights or solutions that can help us correctly convert Japanese .msg files with ISO-2022-JP encoding into .eml files without losing the correct character encoding.
Thank you for your time and expertise.
2