Re: invalid byte sequence ? - Mailing list pgsql-general

From Tom Lane
Subject Re: invalid byte sequence ?
Date
Msg-id 25374.1156373520@sss.pgh.pa.us
Whole thread Raw
In response to Re: invalid byte sequence ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: invalid byte sequence ?
Re: invalid byte sequence ?
List pgsql-general
I wrote:
> We've known about this and related issues with gettext for some time,
> but a bulletproof solution isn't clear.  For the moment all you can
> do is be real careful about making your locale settings match up.

I forgot to mention that it works fine if the server is told the client
encoding actually being used:

postgres=# \encoding iso8859-1
postgres=# \l
        Liste der Datenbanken
    Name    | Eigent�mer | Kodierung
------------+------------+-----------
 postgres   | tgl        | UTF8
 regression | tgl        | SQL_ASCII
 template0  | tgl        | UTF8
 template1  | tgl        | UTF8
(4 Zeilen)

postgres=# \d
Keine Relationen gefunden
postgres=#

A possible solution therefore is to have psql or libpq drive the
client_encoding off the client's locale environment instead of letting
it default to equal the server_encoding.  But I'm not sure what
downsides that would have, and in any case it's not entirely clear that
we can always derive the correct Postgres encoding name from the
system's locale info.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: invalid byte sequence ?
Next
From: Bob Pawley
Date:
Subject: Re: Inserting Data