]> git.phdru.name Git - bookmarks_db.git/blobdiff - Writers/bkmk_whtml.py
Recode hrefs (due to international domain names) to the current charset.
[bookmarks_db.git] / Writers / bkmk_whtml.py
index 8b3cd13ebfd53229608b6610b6e5936978348e12..7f23fb90dcaac51beaec10d0baf7200f5275b051 100644 (file)
@@ -13,6 +13,7 @@ __license__ = "GNU GPL"
 __all__ = ['writer_html']
 
 
+from m_lib.defenc import default_encoding
 from bkmk_objects import Writer, BKMK_FORMAT, quote_title
 
 
@@ -48,7 +49,7 @@ class writer_html(Writer):
       self.outfile.write(ind_s*level + "</DL><p>\n")
 
    def bookmark(self, b, level):
-      self.outfile.write(ind_s*(level+1) + '<DT><A HREF="%s" ADD_DATE="%s"' % (b.href, b.add_date))
+      self.outfile.write(ind_s*(level+1) + '<DT><A HREF="%s" ADD_DATE="%s"' % (b.href.encode(default_encoding), b.add_date))
       if b.last_visit: self.outfile.write('LAST_VISIT="%s"' % b.last_visit)
       self.outfile.write('LAST_MODIFIED="%s"' % b.last_modified)
       if BKMK_FORMAT == "MOZILLA":