Re: Finding bad bye in "invalid byte sequence" error

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: robert <robertlazarski(at)gmail(dot)com>
Subject: Re: Finding bad bye in "invalid byte sequence" error
Date: 2007-12-15 03:02:04
Message-ID: 200712141902.07117.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 13 December 2007 10:38 am, robert wrote:
> Hi all,
>
> I'm trying to hack my inserts script from mssql to work with postgres
> 8.1.9 - I can upgrade if need be. I'm getting this error:
>
> psql -h localhost atdev < fuk2.sql
> ERROR: invalid byte sequence for encoding "UTF8": 0xe1204f
> HINT: This error can also happen if the byte sequence does not match
> the encoding expected by the server, which is controlled by
> "client_encoding".
>
> I tried:
>
> /var/lib/pgsql> recode ascii..utf8 fuk2.sql
> recode: fuk2.sql failed: Invalid input in step `ANSI_X3.4-1968..UTF-8'
>
> And also dos2unix , but nothing is working. 0xe1204f looks like a hex
> address, and I'm trying hexdump to find what its complaining about,
> but that's not helping either. Any ideas?
>
> Robert
>
I had a similiar problem and found I had to set the client encoding as
follows:

SET client_encoding = 'windows-1252';

at the top of my import file.

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2007-12-15 03:19:07 setting and using variables in PSQL ????
Previous Message Adrian Klaver 2007-12-15 02:46:17 Re: mssql migration and boolean to integer problems