Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id BF4461648184 for ; Fri, 30 Mar 2012 14:44:42 -0300 (ADT) Received: from zeus.simkin.ca ([72.51.27.124]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SDfsP-0005BU-Hz for pgsql-general@postgresql.org; Fri, 30 Mar 2012 17:44:42 +0000 Received: from vpn.reinvent.com (vpn.reinvent.com [72.51.27.50]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by zeus.simkin.ca (Postfix) with ESMTPSA id 941A527065C for ; Fri, 30 Mar 2012 10:44:28 -0700 (PDT) From: Alan Hodgson To: pgsql-general@postgresql.org Subject: Re: ERROR: invalid byte sequence for encoding "UTF8": 0xc325 Date: Fri, 30 Mar 2012 10:44:25 -0700 Message-ID: <1985506.VxWsIU199R@skynet.simkin.ca> User-Agent: KMail/4.7.4 (Linux/3.2.12-gentoo; KDE/4.7.4; x86_64; ; ) In-Reply-To: <1333126831.8513.YahooMailClassic@web125702.mail.ne1.yahoo.com> References: <1333126831.8513.YahooMailClassic@web125702.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/965 X-Sequence-Number: 186291 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.