Encoding Problem when reading special characters

Hi,

I'm having problems when reading an excel template workbook, within the workbook template in some cells I have values with special characters for latin encoding like "É" and others like this, when reading the values they are displayed as a blank square, if I set the encoding for the workbook using

[Workbook].Settings.Encoding

the character is displayed as "?"... thing is that when I save data from the application using aspose cells to the workbook (by reentering the real value) it saves without problems then when I look at the sheets the data is well saved so the problem is when reading from the excel. How can I solve this encoding problem? I really appreciate your help.

Regards,

Marcos

Hi,

I think, you don’t need to specify the encoding, just create a workbook object.

Please provide us your source xls/xlsx file. We will look into it asap.

Also try the latest version:
Aspose.Cells for .NET (Latest Version)

Thanks for the quick reply... I tried the latest version of Aspose.Cells but the problem is still there.

I've created the workbook since before this posting so everything should be fine, the problem should be when reading the input sheet I think... though the value in the input sheet is well displayed (É) but when I look in the code the value readed it displays the blank square.

What else do you suggest to try?

I took a look at the FAQs and there's a simillar issue when saving files with special characters... do aspose.cells only permits the usage of US-ASCII encoding? that would mean that special characters such as "É" cannot be used... is that right?

Thank you!

Hi,

I found, the character mentioned by you is reading fine.

Please see the code below. I have attached the source file and the screenshot for your reference.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\source.xlsx”;


Workbook workbook = new Workbook(filePath);


Cell cell = workbook.Worksheets[0].Cells[“A1”];

Screenshot

mm good point… There should be something else going on behind the scenes in my application… I’ll keep working on it to solve it and let you know if anything comes up. Thank you! now I now it should work

Hi,

Unicode is a major character encoding, each Unicode character takes 2 bytes, in order to compress 2 bytes, sometimes UTF8 and UTF7 encoding are used.

MS-Excel uses Unicode characters and not UTF8 and UTF7, so you don’t need to specify encoding for reading xls/xlsx files.

However, for other formats like csv format, you might need to specify encoding.

Please also use the latest version:
Aspose.Cells for .NET (Latest Version)
It should solve your problem.