("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"))))
self.outfile.write(' LAST_MODIFIED="%s"' % b.last_modified)
if BKMK_FORMAT == "MOZILLA":
if b.keyword: self.outfile.write(' SHORTCUTURL="%s"' % b.keyword)
- if b.icon_href: self.outfile.write(' ICON_URI="%s"' % b.icon_href)
+ if b.icon_href:
+ value = b.icon_href
+ if isinstance(value, unicode):
+ value = value.encode('utf-8')
+ self.outfile.write(' ICON_URI="%s"' % value)
if b.icon: self.outfile.write(' ICON="%s"' % b.icon)
if b.charset: self.outfile.write(' LAST_CHARSET="%s"' % b.charset)
self.outfile.write('>%s</A>\n' % quote_title(b.name))