Thread: ERROR: invalid byte sequence for encoding "UTF8": 0xc325

ERROR: invalid byte sequence for encoding "UTF8": 0xc325

From
Prashant Bharucha
Date:
Hello All

Could you help me to automatically convert all db request into UTF8 encode ?

Thx
Prashant

Re: ERROR: invalid byte sequence for encoding "UTF8": 0xc325

From
Alan Hodgson
Date:
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.