]> git.phdru.name Git - bookmarks_db.git/blobdiff - Writers/bkmk_wflad.py
Fix: convert unicode icon URLs to utf-8
[bookmarks_db.git] / Writers / bkmk_wflad.py
index 189177f56cafc66453c8c45eb2363da79828747e..999872b1e488a93c062a3caa3514f0281da33439 100644 (file)
@@ -53,7 +53,10 @@ Comment: %s""" % (level+1, b.name, b.href, strftime(b.add_date), strftime(b.last
             ("real_title", "RealTitle"), ("test_time", "TestTime"),
             ("icon_href", "IconURI"), ("icon", "Icon"), ("charset", "Charset")):
          if hasattr(b, attr_name):
-            self.outfile.write("\n%s: %s" % (attr_out, getattr(b, attr_name)))
+            value = getattr(b, attr_name)
+            if isinstance(value, unicode):
+               value = value.encode('utf-8')
+            self.outfile.write("\n%s: %s" % (attr_out, value))
 
       if hasattr(b, "last_tested"):
          self.outfile.write("\n%s: %s" % ("LastTested", strftime(getattr(b, "last_tested"))))