Trying to change the Encoding property of a document that will be saved as .ODT as outputs some as diamond question mark.
We had the issue with Cells and solve it instantiating a TxtLoadOptions and change t’s Encoding property to UTF7, than provide the instance as argument when instantiating the workbook. Thought might be something similar for Words and tried 2 approaches:
- Aspose.Words.Saving
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.Encoding = System.Text.Encoding.UTF7;
doc.Save(sRepName, saveOptions);
- Aspose.Words.Loading
//Tried this by instantiating a 2nd document that will load 1st doc in (.odt format)
TxtLoadOptions loading = new TxtLoadOptions();
loading.LoadFormat = LoadFormat.Odt;
loading.Encoding = System.Text.Encoding.UTF7;
Document docEncoded = new Document(sRepName, loading);
docEncoded.Save(@"C:\Temp\testEnc.odt"); Process.Start(@"C:\Temp\testEnc.odt");
None of the approaches worked