nickesk / pyactiveresource

Automatically exported from code.google.com/p/pyactiveresource
Other
0 stars 0 forks source link

Encoding trouble #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Save a object with a text value encoded in utf-8 (with accents)

What is the expected output? What do you see instead?
Saving the object without trouble, instead there is an encoding error :

/env/lib/python2.5/site-packages/pyactiveresource/util.py in to_xml(obj, root, 
pretty, header)
    234                 element = ET.SubElement(root_element, key)
    235                 if value is not None:
--> 236                     element.text = str(value)
    237                     if isinstance(value, bool):
    238                         element.text = element.text.lower()
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 
53: ordinal not in 
range(128)

I've attached a patch that fix it (without unit test).

Original issue reported on code.google.com by timothee...@gmail.com on 19 Jun 2009 at 11:05

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch, Timothee. I have fixed that in subversion.

Original comment by mark.r.r...@gmail.com on 19 Jun 2009 at 5:29