Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The query result is messed up in Chinese #1411

Open
1 task
iknownoth1ng opened this issue Jul 4, 2023 · 2 comments
Open
1 task

The query result is messed up in Chinese #1411

iknownoth1ng opened this issue Jul 4, 2023 · 2 comments

Comments

@iknownoth1ng
Copy link

iknownoth1ng commented Jul 4, 2023

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 freeze command.
    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
@dbaty
Copy link
Member

dbaty commented Nov 15, 2023

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?

@dbaty
Copy link
Member

dbaty commented Nov 15, 2023

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants