Encoding Problem when reading special characters

Last post 02-14-2012, 1:39 PM by mshakeel.faiz. 5 replies.
Sort Posts: Previous Next
  •  02-10-2012, 9:19 AM 360751

    Encoding Problem when reading special characters .NET

    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

     
  •  02-10-2012, 9:43 AM 360768 in reply to 360751

    Re: Encoding Problem when reading special characters

    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 v7.1.0.6
    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  02-13-2012, 3:17 PM 361218 in reply to 360768

    Re: Encoding Problem when reading special characters

    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!

     
  •  02-13-2012, 9:17 PM 361279 in reply to 361218

    Re: Encoding Problem when reading special characters

    Attachment: Present (inaccessible)
    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

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  02-14-2012, 9:16 AM 361511 in reply to 361279

    Re: Encoding Problem when reading special characters

    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
     
  •  02-14-2012, 1:39 PM 361602 in reply to 361511

    Re: Encoding Problem when reading special characters

    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 v7.1.0.6 It should solve your problem.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML