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

psql multi-byte character encoding (utf-8) problem #165

Closed
chrishiestand opened this issue Jan 10, 2014 · 2 comments
Closed

psql multi-byte character encoding (utf-8) problem #165

chrishiestand opened this issue Jan 10, 2014 · 2 comments

Comments

@chrishiestand
Copy link

I am running Postgres93.app (v 9.3.1) and I'm having a problem with the command line client "psql" while connecting to postgress.app running on the localhost on OS X. It's behaving as if somewhere a character encoding is set incorrectly, but as far as I can tell, 'UTF-8' or 'UTF8' is correctly set everywhere.

If I enter a unicode character in the psql cli, such as:

user=# select 'ö';

But before hitting enter, use the keyboard "left" button to move the cursor across all the way to the left edge, and then back all the way to the right, the output get distorted and looks like this:

user=#select 'ö';;

If I do hit enter - the command works fine, so the problem is on the display/client side.

Here's why I think all my encodings are set correctly:

user@hostname:~ $ locale
LANG="en_US.UTF-8"
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"
LC_ALL=

user@hostname:~ $ psql
psql (9.3.1)
Type "help" for help.

user=# \encoding
UTF8

user=# \l user
                            List of databases
 Name  | Owner  | Encoding |   Collate   |    Ctype    | Access privileges 
--------+--------+----------+-------------+-------------+-------------------
user   | user   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 

Also if, from my OS X terminal, I ssh into a linux box and run 'psql', the problem does not reproduce. So I'm fairly certain my terminal is not the problem.

I have asked the pgsql-general mailing list, and Tom Lane thinks this version of PostgresApp was compiled against a buggy version of libedit.

@jakob
Copy link
Member

jakob commented Jan 10, 2014

Could you try if the newest pre-release (9.3.2.0) still exhibits the same problems? (See the releases section on github)

Am 10.01.2014 um 07:20 schrieb Chris Hiestand notifications@github.com:

I am running Postgres93.app (v 9.3.1) and I'm having a problem with the command line client "psql" while connecting to postgress.app running on the localhost on OS X. It's behaving as if somewhere a character encoding is set incorrectly, but as far as I can tell, 'UTF-8' or 'UTF8' is correctly set everywhere.

If I enter a unicode character in the psql cli, such as:
user=# select 'ö';

But before hitting enter, use the keyboard "left" button to move the cursor across all the way to the left edge, and then back all the way to the right, the output get distorted and looks like this:
user=#select 'ö';;

If I do hit enter - the command works fine, so the problem is on the display/client side.

Here's why I think all my encodings are set correctly:

user@hostname:~ $ locale
LANG="en_US.UTF-8"
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"
LC_ALL=

user@hostname:~ $ psql
psql (9.3.1)
Type "help" for help.

user=# \encoding
UTF8

user=# \l user
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------+--------+----------+-------------+-------------+-------------------
user | user | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

Also if, from my OS X terminal, I ssh into a linux box and run 'psql', the problem does not reproduce. So I'm fairly certain my terminal is not the problem.

I have asked the pgsql-general mailing list, and Tom Lane thinks this version of PostgresApp was compiled against a buggy version of libedit.


Reply to this email directly or view it on GitHub.

@chrishiestand
Copy link
Author

Thanks jakob - psql in the pre-release does seem to resolve the issue.

@jakob jakob closed this as completed Jan 13, 2014
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