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

Free Support Forum - aspose.com

Setting Encoding type not working with latest version after upgrade

Hi,

I'm using Aspose.Cells for .Net and I've (finally) upgraded to the latest version.

I'm just fixing up my code to comply with the new workbook.Save standard but I can't seem to find where to set the encoding type. Using the old version I used this:

C#
Workbook workbook = new Workbook();
workbook.Settings.Encoding = Encoding.ASCII;

Now there is no such property encoding present in Workbook.Settings.

Any idea how to set encoding now?

Hi,


Thanks for providing us some details.

If you are saving to CSV file format, kindly try using TxtSaveOptions.Encoding property, see the following sample code segment for your reference:
e.g
Sample code:

TxtSaveOptions options = new TxtSaveOptions(SaveFormat.CSV);
options.Encoding = System.Text.Encoding.ASCII;
workbook.Save(“e:\test2\out1.csv”, options);

And, if you are saving to HTML file format, you may use HtmlSaveOptions.Encoding attribute in the same way as mentioned above.

Hope, this helps a bit.

Thank you.