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

Free Support Forum - aspose.com

How encode an Aspose.Words.Document to another encoding (like iso-8859-1 or another)

Hi,
I’d like to encode an Aspose.Words.Document to another encoding and I’m stuck.
Could you help me please?
Thank you
Yohann

Hi,

Please elaborate your question. What encoding do you mean? You can provide some examples of how to do that in Microsoft Word if possible.

I want to save my document (with an html format) but i’d like to specify too the encoding of my html document.
My code is :
------------------------------------------------------------------------------------
saveFileDialog1.Title = “Enregistrer un fichier”;
saveFileDialog1.FileName = “”;
saveFileDialog1.Filter = “Fichiers html (.html)|.html”;
if (saveFileDialog1.ShowDialog(this) == DialogResult.OK)
{
string nomfichier = saveFileDialog1.FileName;
doc.SaveOptions.HtmlExportImagesFolderAlias = “images”;
doc.SaveOptions.ExportImagesFolder = “images”;
DirectoryInfo di = new DirectoryInfo(doc.SaveOptions.ExportImagesFolder);
if (!di.Exists)
{
di.Create();
}
FileStream fs = new FileStream(nomfichier, FileMode.Create);
doc.Save(fs,SaveFormat.Html);
fs.Close();
}
-----------------------------------------------------------------------------------

We have had a similar request recently and logged it as issue #1552 to implement the possibility of specifying an HTML encoding later. In the meantime please use the following workaround:

https://forum.aspose.com/t/120743

In that code sample standard UTF-8 encoded HTML file produced by Aspose.Words is encoded into another encoding (Windows-1252). You can specify any destination encoding you need.

Thank your for your answer.
I solve my problem.

The issues you have found earlier (filed as 1552) have been fixed in this update.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan