I get an Excel file whose contents I cannot influence. It contains some Unicode characters, such as "á" or "é".
My code has not changed, but I migrated from Eclipse Juno to LiClipse along with porting to another python package (2.6 of 2.5). In principle, the specific package that I use has a working version on the win32com package.
When I read the Excel file, my code crashes when fetching and converting to strings using str (). The console output is as follows:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 89: ordinal not in range(128)
More specifically, I do the following:
Read Excel:
xlApp = Dispatch("Excel.Application")
excel = xlApp.Workbooks.Open(excel_location)
in the inner loop, I retrieve the cell value:
cell_value = self.excel.ActiveSheet.Cells(excel_line + 1, excel_column + 1)
and finally, if I try to convert cell_value to str, it crashes:
print str(cell_value)
Excel , ASCII, . . , , , .
, , Excel, LiClipse 2.6 Python .
, ?