How to set encoding to workbook

Aspose cells paid version : 20.2.0

How to set Encoding.UTF8 to workbook before saving , There are some utf characters that are not getting rendered in cell

code below

//Create a workbook

Workbook workbook = new Workbook() { FileFormat = Aspose.Cells.FileFormatType.Html };


Worksheet worksheet = workbook.Worksheets[0];
//Add some sample data
worksheet.Cells[“A1”].HtmlString ="with a combined positive score (CPS) **&#8805** 10 (see section 5.1).";
worksheet.Cells[“A2”].HtmlString = "Store in a refrigerator (2&#176C &#8211 8&#176C).";

workbook.Save(memStream, Aspose.Cells.SaveFormat.Xlsx  );

Settings.Encoding option is not available in this version

Thanks
Asif

@asif2,

Thanks for the details.

Please provide your input file (if any, output file (by Aspose.Cells APIs) and paste complete sample code (runnable), we will evaluate your issue in details. Also attach your expected file, you may create/update your expected file in MS Excel manually.

PS. please zip the files prior attaching.

Edited and added code in the post, Thanks

@asif2,
Thank you for providing the sample code. It seems that your strings are not formatted properly. Please try with the following sample code where &#8211 should be replaced with 舑 then it produces the correct result. Please give a try to the following sample code and share the feedback. For testing I have added one more sample value for your reference:

Workbook workbook = new Workbook() { FileFormat = Aspose.Cells.FileFormatType.Html };
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells["A1"].HtmlString = "with a combined positive score (CPS) **蠅** 10 (see section 5.1).";
worksheet.Cells["A2"].HtmlString = "Store in a refrigerator (2ᝬ 舑 8ᝬ).";
worksheet.Cells["A3"].HtmlString = "I will display ∑";
workbook.Save("output.xlsx", Aspose.Cells.SaveFormat.Xlsx);

Following is the output in the XLSX file:

with a combined positive score (CPS) **蠅** 10 (see section 5.1).
Store in a refrigerator (2ᝬ 舑 8ᝬ).
I will display ∑

Thanks @ahsaniqbalsidiqui , Issue resolved

Without semicolon it renders in html page but excel required semicolon

Thanks for quick response , please feel free to close this ticket

@asif2,

Good to know that you are up and running again. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.