Re: invalid byte sequence for encoding "UTF8": 0xff

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Ashish Karalkar <ashish(dot)karalkar(at)info-spectrum(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: invalid byte sequence for encoding "UTF8": 0xff
Date: 2007-09-03 08:15:56
Message-ID: 20070903081556.GA20844@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 03, 2007 at 01:36:58PM +0530, Ashish Karalkar wrote:
> Hello All,
>
> I have a data script which runs fine from PgAdmin SQL Editor,but when I run this from command prompt I get following error:
> test=# \i /usr/local/pgsql/qsweb1/QSWEB_100_4_Default_Data.sql
>
> psql:/usr/local/pgsql/qsweb1/QSWEB_100_4_Default_Data.sql:1: ERROR: invalid byt
> e sequence for encoding "UTF8": 0xff
> HINT: This error can also happen if the byte sequence does not match the encodi
> ng expected by the server, which is controlled by "client_encoding".

Well, the error is correct, that's not a valid UTF-8 character. I seem
to remember someone saying that ooasionally windows puts BOMs in UTF-8
files (which is completely bogus). Check the file using a simple text
editor a check if there are some odd characters at the beginning of the
file.

Have a ncie 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

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2007-09-03 08:31:30 Instances where enable_seqscan = false is good
Previous Message Ashish Karalkar 2007-09-03 08:06:58 invalid byte sequence for encoding "UTF8": 0xff