Skip site navigation (1) Skip section navigation (2)

Re: BUG #6452: psql: can't change client encoding from the command line

From: Félix GERZAGUET <felix(dot)gerzaguet(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6452: psql: can't change client encoding from the command line
Date: 2012-02-15 17:37:22
Message-ID: CANVwZtvnK4UX0LJcEkpdLkhTtv3q2R+yigJ7Sw2XXdb-t-PxLA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Thanks for the workaround. I'll use it untill the bug is fixed :-)

--
Félix



On Tue, Feb 14, 2012 at 1:41 PM, Heikki Linnakangas <
heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:

> On 11.02.2012 20:02, felix(dot)gerzaguet(at)gmail(dot)com wrote:
>
>> Using the command line, I can't change the client encoding, but I can
>> change
>> it using the "\encoding" command :
>>
>> C:\>psql --variable=ENCODING=UTF8
>> could not find a "psql" to execute
>> could not find a "psql" to execute
>> psql (9.1.2)
>> WARNING: Console code page (850) differs from Windows code page (1252)
>>          8-bit characters might not work correctly. See psql reference
>>          page "Notes for Windows users" for details.
>> Type "help" for help.
>>
>> postgres=# \encoding
>> WIN1252
>> postgres=# \echo :ENCODING
>> WIN1252
>> postgres=# \encoding UTF8
>> postgres=# \encoding
>> UTF8
>> postgres=# \echo :ENCODING
>> UTF8
>> postgres=# \q
>>
>
> Yeah, "\set ENCODING UTF8" doesn't seem to work either. The "ENCODING"
> psql variable tracks changes to the server's client_encoding setting, but
> not vice versa. That probably should be fixed, or at least it should throw
> an error telling the user to use \encoding instead.
>
> As a workaround, you can set the PGCLIENTENCODING environment variable
> before launching psql.
>
> --
>  Heikki Linnakangas
>  EnterpriseDB   http://www.enterprisedb.com
>

In response to

pgsql-bugs by date

Next:From: yannick godboutDate: 2012-02-15 23:52:06
Subject: probleme d'installation
Previous:From: Duncan RanceDate: 2012-02-15 09:21:13
Subject: Re: BUG #6457: Regexp not processing word (with special characters on ends) correctly (UTF-8)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group