dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.12k stars 68 forks source link

'ascii' codec can't decode byte 0xe2 in position 103: ordinal not in range(128) #55

Closed ge0rg closed 3 years ago

ge0rg commented 5 years ago

When doing a SELECT somerow FROM table;, with somerow containing data that's not valid ASCII, there is no output of data at all from litecli 1.0.0, but only the cryptic python error message:

'ascii' codec can't decode byte 0xe2 in position 103: ordinal not in range(128)

I haven't found any options to change the expected file / output encoding, besides of PRAGMA encoding which is set to UTF-8.

Ideally, litecli should output whatever it can, with invalid characters replaced by replacement character �.

elig0n commented 5 years ago

Try to run litecli with Python 3. i.e. on Linux:

python3 $(which litecli)

If you installed via pip, install via pip3:

pip3 install litecli
amjith commented 5 years ago

@ge0rg Can you paste the output you see from running that command using the sqlite default shell?

amjith commented 3 years ago

I believe this is now fixed in the latest release 1.6.0.

You can upgrade using pip install -U litecli.

Feel free to reopen the issue if this still persists.