]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/exporter/exporter.py
Reintegrate merge cacheimp -> trunk.
[osqa.git] / forum_modules / exporter / exporter.py
index 49f89da34941e75f7e80f90e1064801846b29446..2db3ca232a71e3cc2c641b015dbffaaf7c1fb439 100644 (file)
@@ -93,8 +93,13 @@ def ET_Element_add_tag(el, tag_name, content = None, **attrs):
     if content:
         try:
             tag.text = unicode(content)
-        except:
-            tag.text = u''
+        except Exception, e:
+            logging.error('error converting unicode characters')
+            import traceback
+            logging.error(traceback.print_exc())
+
+            import string
+            tag.text = unicode("".join([c for c in content if c in string.printable]))
 
     for k, v in attrs.items():
         tag.set(k, unicode(v))