KnugiHK / WhatsApp-Chat-Exporter

A customizable Android and iOS/iPadOS WhatsApp database parser that will give you the history of your WhatsApp conversations in HTML and JSON. Android Backup Crypt12, Crypt14, Crypt15, and new schema supported.
https://wts.knugi.dev/
MIT License
553 stars 81 forks source link

sqlite3.OperationalError: Could not decode to UTF-8 column 'data' with text #44

Open Stratos-Crimson opened 1 year ago

Stratos-Crimson commented 1 year ago

Hello, I suspect that this is due to some of the database not being in UTF-8. I got around this on another program that also exports Whatsapp messages by adding the following code: db.text_factory = lambda b: b.decode(errors = 'ignore') after this code which was already there, db = sqlite3.connect(file_path) But when I tried to do this in this program, I couldn't find It in the extract python files. I instead found, this....

if os.path.isfile(contact_db):
    with sqlite3.connect(contact_db) as db:
        contacts(db, data)
if os.path.isfile(msg_db):
    with sqlite3.connect(msg_db) as db:
        messages(db, data)
        media(db, data, media_folder)
        vcard(db, data)
    create_html(data, output_folder)

Which is beyond my understanding.

KnugiHK commented 1 year ago

The workaround is released in 0.9.5.