green
green

Reputation: 713

PostgreSQL psql with Strange Characters

I received lot of strange characters when Im trying to use the psql tool and really get frustrated with it. Anyone has faced the same problem and how it can be solved. Thanks in advance for all the respond.

enter image description here

Upvotes: 2

Views: 2399

Answers (1)

Pavel Stehule
Pavel Stehule

Reputation: 45930

It is a known problem of MS windows shell (it doesn't support most popular unix utf8 encoding well). Your client encoding and server encoding is different, and it is reason of described issue, so you have to find some encoding, that is supported by PostgreSQL and MS windows too. I don't know what is your language - so, I don't know a best encoding. I can write a setup for Czech language (probably for your language the setup will be similar):

  • run cmd with parameter /c chcp 1250
  • set client encoding - a sql statement SET CLIENT_ENCODING TO 'win1250'; this statement can be saved in your .psqlrc file in your home directory
  • change a terminal font to Lucida (or some font with utf support)

I found a link: http://pgolub.wordpress.com/2008/12/23/windows-linux-psql/

Upvotes: 3

Related Questions