]> git.phdru.name Git - bookmarks_db.git/blobdiff - bkmk_objects.py
Fix(Py3): Stop encoding unicode to bytes
[bookmarks_db.git] / bkmk_objects.py
index 4850261ef529c854708b5eb0437323720ed9d41e..b9dabff1e316a66c36d14a9f3d0911f4b60f6b2c 100644 (file)
@@ -85,7 +85,7 @@ class Bookmark(object):
                 href += ':' + quote(password)
             href += '@'
         if host:
-            href += host.decode(parser_charset or 'utf-8').encode('idna')
+            href += host.encode('idna').decode('ascii')
             if port:
                 href += ':%d' % port
         if path:
@@ -230,8 +230,8 @@ def unquote_title(title):
     if BKMK_FORMAT == "MOZILLA":
         from HTMLParser import HTMLParser
         title = HTMLParser().unescape(
-            title.replace("&", '&').decode('utf-8'))
-        title = title.encode('utf-8').replace("'", "'")
+            title.replace("&", '&'))
+        title = title.replace("'", "'")
     return title