On Thu, 3 Oct 2019 09:46:27 +0000, suan...@outlook.com wrote:

> In column mode, each record is shown on a separate
> line with the data aligned in columns. For example:
> sqlite> .mode column
> sqlite> select * from tbl1;
> one           two       
> ----------  ----------
> hello         10        
> goodbye   20        
> sqlite>
>
> But I found,only when columns text is ANSI,it can normal work.
> sqlite> .mode column
> sqlite> select * from ?????;
> ????        ????        ????        ????
> ----------  ----------  ----------  ----------
> 1           0           1           0
> 2           0           2           0
>
> If the columns text is utf-8,it can't work.
> What should I do for it?


It works for me, using UTF-8 language settings for the terminal,
and a font that contains enough of UTF-8.

~ $ uname -a
Linux f7p3 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

~ $ set|grep -E '(LC_|LANG)'
LANG=en_US.utf-8
LC_ALL=
LC_COLLATE=en_US.utf-8
LC_CTYPE=en_US.utf-8
LC_MESSAGES=en_US.utf-8
LC_MONETARY=en_US.utf-8
LC_NUMERIC=en_US.utf-8
LC_TIME=en_US.utf-8

Column names used: e-acute and a-umlaut

~ $ sqlite3 test.db
SQLite version 3.30.0 2019-09-25 18:44:49
Enter ".help" for usage hints.
sqlite> CREATE TABLE x (é integer primary key,ä TEXT);
sqlite> INSERT INTO x VALUES (1,'téxt');
sqlite> . mode column
sqlite> . head on
sqlite> select * FROM x;
é           ä
----------  ----------
1           téxt
sqlite>.q

~ $ sqlite3 test.db \
".mode column" ".head on" ".width 1 4" "SELECT * FROM x" \
| hexdump -C

0000 c3 a9 20 20 c3 a4 20 20  20 0a 2d 20 20 2d 2d 2d |..  ..   .-  ---|
0010 2d 0a 31 20 20 74 c3 a9  78 74 0a                |-.1  t..xt.|
001b

-- 
Regards,
Kees Nuyt
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to