summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkopertop <kopertop@604d75c7-a419-0410-a38f-bde1a0bd1dbf>2009-11-25 14:04:55 +0000
committerkopertop <kopertop@604d75c7-a419-0410-a38f-bde1a0bd1dbf>2009-11-25 14:04:55 +0000
commit18ff75a04db1caf1f76121416feb3edef1da29ed (patch)
tree0e247e31d7bd64aa1317f9ed11efb81920f8954a
parenta9e0f2a191673bd67e4729ab2d7a8005a03a06fa (diff)
downloadboto-18ff75a04db1caf1f76121416feb3edef1da29ed.tar.gz
Fixed up to_xml dumping of entire domains to properly handle unicode characters
-rw-r--r--boto/sdb/domain.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/boto/sdb/domain.py b/boto/sdb/domain.py
index d0041235..3c0def69 100644
--- a/boto/sdb/domain.py
+++ b/boto/sdb/domain.py
@@ -207,7 +207,13 @@ class Domain:
if not isinstance(values, list):
values = [values]
for value in values:
- print >>f, '\t\t\t<value><![CDATA[ %s ]]></value>' % (str(value.encode('utf-8')))
+ print >>f, '\t\t\t<value><![CDATA[',
+ if isinstance(value, unicode):
+ value = value.encode('utf-8', 'replace')
+ else:
+ value = unicode(value, errors='replace').encode('utf-8', 'replace')
+ f.write(value)
+ print >>f, ']]></value>'
print >>f, '\t\t</attribute>'
print >>f, '\t</Item>'
print >>f, '</Domain>'