Loading HTML containing Arabic into Workbook

Hi,


Attached is a simple test file that takes a 1 row 1 col HTML table containing Arabic text, converting it into a byte[], then MemoryStream and finally inserting the stream into a workbook. I then save the workbook as an xlsx file and view it.

If you take a look at the output xlsx file, you will see that the Arabic text now looks like the following

استهداف مستخدمين محددين زاروا موقعهم من قبل

Can you please take a look at my code and tell me what I’m doing wrong?


Thanks,

Nathan

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v7.5.1.2

I have tested your scenario a bit using the following code and it works fine. The output Excel file has correct Arabic text in it.

Sample code:

LoadOptions loadOptions = new HTMLLoadOptions(LoadFormat.Html);
string html = “
استهداف مستخدمين محددين زاروا موقعهم من قبل
”;
byte[] data = Encoding.UTF8.GetBytes(html);
MemoryStream stream = new MemoryStream(data);

Workbook workbook = new Workbook(stream, loadOptions);
workbook.Save(“e:\test2\outputtext1.xlsx”, SaveFormat.Xlsx);

Thank you.

Using a newer aspose.cells version fixed the problem. Thanks!

Hi,


Thanks for your feedback.

Good to know that your issue is resolved now.
Feel free to contact us any time if you need further help or have some other issue. We will be happy to assist you soon.

Thank you.