The sqlite3 CLI doesn't count multi-byte characters correctly:
sqlite> create table test (id text primary key);
sqlite> insert into test values ('123456');
sqlite> insert into test values ('abcdef');
sqlite> insert into test values ('äöüäöü');
sqlite> .mode column
sqlite> .width 4
sqlite> select * from test;
1234
abcd
äö
Kind regards,
Martin
tags 536662 unreproducible moreinfo
thanks
Hi Martin,
I can't reproduce it with the current version in testing:
SQLite version 3.6.14.2
sqlite> create table test (id text primary key);
sqlite> insert into test values ('123456');
sqlite> insert into test values ('abcdef');
sqlite> insert into test values ('äöüäöü');
sqlite> select * from test;
123456
abcdef
äöüäöü
sqlite> .mode column
sqlite> .width 4
sqlite> select * from test;
1234
abcd
äöüä
It works as expected. Can it be your terminal that strip characters? Can
you update your version of sqlite3 to 3.6.14.2 at least?
Regards,
Laszlo/GCS
stop ---- Hello, Martin Godisch uses an example with the width option to highlight the problem. However, I think this is the column mode that does not comply with UTF-8, rather than the width option. I still found this bug in version 3.7.13-1 for Debian testing on an x86 architecture, without modifications. The attached script demonstrates the problem. I tested it with the linux framebuffer, rxvt-unicode and a redirection to make sure it is not a problem of configuration of the terminal. Regards,
forwarded 536662 https://www.sqlite.org/src/tktview/6c266900a22574d4d6474503da5bfe849c8b244f stop