diff options
author | B. Stack <bgstack15@gmail.com> | 2022-03-05 21:28:05 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-03-05 21:28:05 -0500 |
commit | cd17ac14d27b94b27f881a3b4a73e4e985d984b8 (patch) | |
tree | 0432bc6db3c58b7e67e65508de2c25402b97b7c9 | |
parent | add 15-column support for LibreWolf (diff) | |
download | mbbmlib-cd17ac14d27b94b27f881a3b4a73e4e985d984b8.tar.gz mbbmlib-cd17ac14d27b94b27f881a3b4a73e4e985d984b8.tar.bz2 mbbmlib-cd17ac14d27b94b27f881a3b4a73e4e985d984b8.zip |
fix more UTF-8 errors
-rw-r--r-- | mbbmlib.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -6,6 +6,7 @@ # Title: Export Firefox Bookmarks to Html # Purpose: Add favicons to bookmarks in exported html file # History: +# 2022-03-05 fix even more UTF-8 crap # Usage: # main command is export_bookmarks_to_html. # Reference: @@ -16,6 +17,7 @@ # https://stackoverflow.com/questions/43446353/converting-png-images-to-base64 # future: https://stackoverflow.com/questions/5119041/how-can-i-get-a-web-sites-favicon # https://rosettacode.org/wiki/Strip_control_codes_and_extended_characters_from_a_string#Python +# conn.text_factory to fix UTF-8 crap https://stackoverflow.com/questions/22751363/sqlite3-operationalerror-could-not-decode-to-utf-8-column/58891189#58891189 # Improve: # add to pretty_print the option to select what format the output is in, like "title | url | icon" or similar. # Documentation: @@ -299,6 +301,7 @@ class Bookmark: if debuglev > 4: print("Using places file {0} and icons_file {1}".format(places_file,icons_file)) with sqlite3.connect(places_file) as conn: + conn.text_factory = lambda b: b.decode(errors = 'ignore') # detect browser automatically if browser == 'autodetect': |