Skip to content

Crash on accented chars. #1

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Add a string with accented chars in a document.

What is the expected output? What do you see instead?
The library crashes so there is no output. But there is a traceback :

Traceback (most recent call last):
  File "/home/thierry/Documents/rainette/rainette-dir/NoteBookPanel.py", line 149, in Export
    self.main_ctrl.Export()
  File "/home/thierry/Documents/rainette/rainette-dir/AnnualPlanning.py", line 342, in Export
    self.ExportODS()
  File "/home/thierry/Documents/rainette/rainette-dir/AnnualPlanning.py", line 446, in ExportODS
    doc.content.getCell(c, r).stringValue(self.GetCellValue(r, c))
  File "/home/thierry/Documents/rainette/rainette-dir/odslib/odsContent.py", line 134, in stringValue
    value = str(value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: 
ordinal not in range(128)

What version of the product are you using? On what operating system?
odslib-python r54 under linux mint (python 2.7.3)

Please provide any additional information below.
This issue can be solved easily by replacing str() calls by unicode() in 
odsContent.py.

The corrected file is attached.

Original issue reported on code.google.com by loic.mer...@gmail.com on 16 Jul 2012 at 3:43

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions