Re: invalid byte sequence ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas <maps(dot)on(at)gmx(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: invalid byte sequence ?
Date: 2006-08-23 22:52:00
Message-ID: 25374.1156373520@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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 | Eigentmer | 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-08-23 22:53:55 Re: CASCADING could not open relation with OID
Previous Message Bob Pawley 2006-08-23 22:51:45 Re: Inserting Data

Browse pgsql-hackers by date

  From Date Subject
Next Message mdean 2006-08-24 00:24:04 Re: ISBN/ISSN/ISMN/EAN13 module
Previous Message Bruce Momjian 2006-08-23 22:47:54 Re: invalid byte sequence ?