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

Free Support Forum - aspose.com

WorkbookSettings.setEncoding deprecated?

Hi,


so far I used the following code:

Workbook workbook = new Workbook();
workbook.getSettings().setEncoding(Encoding.getUTF8());

Now I see it’s deprecated in the latest Aspose.Cells for Java release. But I can’t see any info about that in the release notes and I can’t find a new way to set the encoding. Can you help me with that?

Thank you,
Mariusz

Hi,


Well, you may try with the new versions now:
e.g
Sample code:

Workbook workbook = new Workbook();

TxtSaveOptions options = new TxtSaveOptions();
options.setEncoding(Encoding.getUTF8());
workbook.save(“out1.csv”, options);

Thank you.

But I’m saving it as XLS, not CSV, if I don’t set the encoding, the characters are very often wrongly represented in the output.

Hi,


Well, specifying encoding type applies only to Text or CSV file formats, it does not apply to XLS/XLSX file formats, you do not need to specify encoding type for XLS or XLSX file formats.


Thank you.