We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Outlook Msg File in French not converted properly

We recently updated to the latest version of Aspose.Email v4.1.0.0 to convert msg files to tiff.

When we receive an email in French, the characters are not being converted properly. Review the code snippet below:

The previous version of Aspose.Email did work for this.

AsposeEmail.Mail.MailMessageLoadOptions loadOptions = new AsposeEmail.Mail.MailMessageLoadOptions
{
PrefferedTextEncoding = Encoding.GetEncoding(65001),
MessageFormat = AsposeEmail.Mail.MessageFormat.Msg
};

message = AsposeEmail.Mail.MailMessage.Load(stream, loadOptions);

MemoryStream ms;
using (ms = new MemoryStream())
{
message.Save(ms, AsposeEmail.Mail.MailMessageSaveType.MHtmlFormat);
}

The message file used for testing and the resulting file is attached.
What am I missing?

Hi Ralph,


Thank you for using Aspose.Email.

I have tested this issue with the latest version of Aspose.Email for .NET 4.2.0 and was unable to observe the issue as you have specified. The intermediate MHTML file is converted fine with appropriate French characters. I have attached the output MHTML file here for your kind reference that is generated using the code segment below:

Sample Code:


string dir = “EMAIL_553538\”;

MailMessage msg = MailMessage.Load(dir + “test.msg”);

msg.Save(dir + “test.mhtml”, MailMessageSaveType.MHtmlFormat);

Thanks for your reply. After further examination of the code. it appears that after we save the MailMessage, we then load it into an Aspose.Words object. When I do document.GetText(), i see that the text is not correct. See my code below…


protected void LoadFromStream(Stream stream)
{
this.document = new AsposeWords.Document(stream);
}

the variable - stream is the stream from a saved Aspose.Email object. This had worked in previous versions of your product.

This is the result of Aspose.Email.Mail.MailMessage.Body:
Maître Corbeau, sur un arbre perché,
Tenait en son bec un fromage.
Maître Renard, par l’odeur alléché,
Lui tint à peu près ce langage :
« Hé ! bonjour, Monsieur du Corbeau.
Que vous êtes joli ! que vous me semblez beau !
Sans mentir, si votre ramage
Se rapporte à votre plumage,
Vous êtes le Phénix des hôtes de ces bois. »
A ces mots le Corbeau ne se sent pas de joie ;
Et pour montrer sa belle voix,
Il ouvre un large bec, laisse tomber sa proie.
Le Renard s’en saisit, et dit : « Mon bon Monsieur,
Apprenez que tout flatteur
Vit aux dépens de celui qui l’écoute :
Cette leçon vaut bien un fromage, sans doute. »
Le Corbeau, honteux et confus,
Jura, mais un peu tard, qu’on ne l’y prendrait plus.

[cid:image001.png@01CF8977.A9B3A530]



Jim Herr
Customer Solutions Specialist
KnowledgeLake, INC <http://www.knowledgelake.com/>
O: 314.898.0537 | C: | jim.herr@knowledgelake.com<mailto:jim.herr@knowledgelake.com>

» Follow us: twitter <http://twitter.com/knowledgelake> | facebook <http://www.facebook.com/knowledgelake> | LinkedIn <http://www.linkedin.com/company/knowledgelake> | KnowledgeLake Blog <http://knowledgelake.com/blog>

This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited.




This is the result of document.GetText();
Jim Herr
From: Jim HerrSent: 16 Jun 2014 20:28:49 +0000To: Test UserSubject: test
Ma?tre Corbeau, sur un arbre perch?,Tenait en son bec un fromage.Ma?tre Renard, par l’odeur all?ch?,Lui tint ? peu pr?s ce langage :? H? ! bonjour, Monsieur du Corbeau.Que vous ?tes joli ! que vous me semblez beau !Sans mentir, si votre ramageSe rapporte ? votre plumage,Vous ?tes le Ph?nix des h?tes de ces bois. ?A ces mots le Corbeau ne se sent pas de joie ;Et pour montrer sa belle voix,Il ouvre un large bec, laisse tomber sa proie.Le Renard s’en saisit, et dit : ? Mon bon Monsieur,Apprenez que tout flatteurVit aux d?pens de celui qui l’?coute :Cette le?on vaut bien un fromage, sans doute. ?Le Corbeau, honteux et confus,Jura, mais un peu tard, qu’on ne l’y prendrait plus.aaa
Jim Herr
Customer Solutions Specialist
HYPERLINK “http://www.knowledgelake.com/” KnowledgeLake, INC
O: 314.898.0537 | C: | HYPERLINK “mailto:jim.herr@knowledgelake.comjim.herr@knowledgelake.com
? Follow us: HYPERLINK “http://twitter.com/knowledgelake” twitter | HYPERLINK “http://www.facebook.com/knowledgelake” facebook | HYPERLINK “http://www.linkedin.com/company/knowledgelake” LinkedIn | HYPERLINK “http://knowledgelake.com/blog” KnowledgeLake Blog
This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited.

Hi Ralph,


I have tested this issue with latest version of Aspose.Words for .NET 14.5.0 and Aspose.Email for .NET 4.2.0 and I was unable to observe any such issue as reported by you. Please have a look at the attached TIFF file for your kind reference. I am also moving this thread to Aspose.Total forum so that, if required, relevant support team member from Aspose.Words team can also assist you in this regard.

Sample Code:

string dir = “EMAIL_553538\”;


MailMessage msg = MailMessage.Load(dir + “test.msg”);

msg.Save(dir + “test.mhtml”, MailMessageSaveType.MHtmlFormat);

LoadOptions lo = new Aspose.Words.LoadOptions();

lo.LoadFormat = LoadFormat.Mhtml;

Document doc = new Document(dir + “test.mhtml”, lo);

doc.Save(dir + “Test.Tiff”, SaveFormat.Tiff);


Thank you, I needed to update to the latest version of both Aspose.Email and Aspose.Words for it to work.