pgcli
pgcli copied to clipboard
The query result is messed up in Chinese
Description
select * from table_name limit 10;
OK!!!
select * from table_name;
garbled!!!
Your environment
os: win10 Server: PostgreSQL 11.3 pgcli-Version: 3.5.0
- [ ] What is the output of
pip freezecommand. bcrypt==4.0.1 cffi==1.15.1 cli-helpers==2.3.0 click==8.1.3 colorama==0.4.6 configobj==5.0.8 cryptography==36.0.2 importlib-resources==5.12.0 mycli==1.26.1 paramiko==3.2.0 pendulum==2.1.2 pgcli==3.5.0 pgspecial==2.1.0 prompt-toolkit==3.0.38 psycopg==3.1.9 psycopg-binary==3.1.9 psycopg2==2.9.6 pyaes==1.6.1 pycparser==2.21 Pygments==2.15.1 PyMySQL==1.1.0 PyNaCl==1.5.0 pyperclip==1.8.2 python-dateutil==2.8.2 pytzdata==2020.1 setproctitle==1.3.2 six==1.16.0 sqlglot==16.8.1 sqlparse==0.4.4 sshtunnel==0.4.0 tabulate==0.9.0 typing_extensions==4.7.1 tzdata==2023.3 wcwidth==0.2.6 zipp==3.15.0
Thanks for your report. Do you have a way to reproduce this bug? I don't speak nor write Chinese, so my naïve attempt did not produce anything suspicious when running in pgcli:
> create table chinese_chars (t text);
CREATE TABLE
> insert into chinese_chars (t) values ('繁体字')
INSERT 0 1
> select * from chinese_chars
+--------+
| t |
|--------|
| 繁体字 |
+--------+
SELECT 1
I am looking for a particular insert into query that would trigger this bug. Also, do you have this issue within pgcli itself? Your screenshots have timestamps and line numbers: could it be that you are using a distinct tool to read a file produced by pgcli?
See also #833 for the same bug reported by someone else. (Given that both have been reported years ago, I'll keep both issues so that both reporters have a chance to say whether they still have this error.)