simonw / db-to-sqlite

CLI tool for exporting tables or queries from any SQL database to a SQLite file
Apache License 2.0
368 stars 28 forks source link

Decoding error when charset not correctly specified in connection string #30

Closed justinpinkney closed 3 years ago

justinpinkney commented 3 years ago

Using db-to-sqlite to copy a MariaDB database on Windows produced an error about character encodings

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 17: character maps to <undefined>

I fixed this by appending ?charset=utf8mb4 to the connection string, see: https://stackoverflow.com/a/48316009

justinpinkney commented 3 years ago

I think this is on the user to make sure they specify their sqlalchemy connection string correctly, but just recording here in case others have the same issue.