Re: ERROR: invalid byte sequence for encoding "UTF8": 0xc325 - Mailing list pgsql-general

From Alan Hodgson
Subject Re: ERROR: invalid byte sequence for encoding "UTF8": 0xc325
Date
Msg-id 1985506.VxWsIU199R@skynet.simkin.ca
Whole thread Raw
In response to ERROR: invalid byte sequence for encoding "UTF8": 0xc325  (Prashant Bharucha <prashantbharucha@yahoo.ca>)
List pgsql-general
On Friday, March 30, 2012 10:00:31 AM Prashant Bharucha wrote:
> Hello All
>
> Could you help me to automatically convert all db request into UTF8 encode ?
>

Set your session client_encoding to match your data. That's about as close as
you can get to automatic.

  http://www.postgresql.org/docs/9.1/static/multibyte.html

A better bet is to make your application end-to-end UTF8, which is doable,
more or less, in a web environment, although misbehaving clients will still
sometimes send you bad data. For any other data source (especially email)
you'll probably get tons of badly encoded data.

If you're looking for a silver bullet, there isn't one.


pgsql-general by date:

Previous
From: Mike Roest
Date:
Subject: Re: pg_dump incredibly slow dumping a single schema from a large db
Next
From: Tom Lane
Date:
Subject: Re: pg_dump incredibly slow dumping a single schema from a large db