Re: invalid byte sequence ?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andreas <maps(dot)on(at)gmx(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: invalid byte sequence ?
Date: 2006-08-24 09:57:15
Message-ID: 20060824095715.GB24070@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wed, Aug 23, 2006 at 06:52:00PM -0400, Tom Lane wrote:
> 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.

For glibc systems we can get 100% reliable results. Even for other
systems there's standard code out there for determining the charset.
But this has been discussed before:

http://archives.postgresql.org/pgsql-hackers/2003-05/msg00744.php
http://archives.postgresql.org/pgsql-general/2004-04/msg00470.php
http://archives.postgresql.org/pgsql-hackers/2006-06/msg01027.php

It seems to me that setting the client encoding based on the
client-locale is the *only* sensible way of doing it. The locale is
going to effect the results of programs like sort and any scripts used
to process the data anyway.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gibson 2006-08-24 10:25:28 Saving a jpg into Postgresql table
Previous Message Michael Meskes 2006-08-24 09:11:20 Re: Shared Objects (Dynamic loading)

Browse pgsql-hackers by date

  From Date Subject
Next Message Zoltan Boszormenyi 2006-08-24 10:05:28 Re: [HACKERS] COPY view
Previous Message Zoltan Boszormenyi 2006-08-24 09:53:31 Re: [HACKERS] COPY view