Re: invalid byte sequence for encoding "UTF8"

From: "Usama Dar" <munir(dot)usama(at)gmail(dot)com>
To: "Glyn Astill" <glynastill(at)yahoo(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: invalid byte sequence for encoding "UTF8"
Date: 2007-11-30 10:01:21
Message-ID: ff0e67090711300201p1c30fc7anab75deed0ebcc705@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/30/07, Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk> wrote:
>
> Hi People,
>
> I've setup a postgres 8.2 server and have a database setup with UTF8
> encoding. I intend to read some of our legacy data into the table,
> this legacy data is in ASCII format, and as far as I know is 8 bit
> ASCII.
>
> We have a migration tool from mertechdata.com to convert these files
> that are in a DataFlex format into out postgres tables.
>
> Some files convert over okay, and some come up with the error message
> 'invalid byte sequence for encoding "UTF8"'. the files that come up
> with the error are created correctly and so are their index's, but as
> soon as we come to insert the data we get this error.
>
> Does anyone know why we're getting this error message? And uis there
> a way to suppress it, or can we get around it using another format?
>
> Our migration utility does ask us to select the correct encoding for
> our database, and we select UTF8 but we still get the error. What do
> you guys think? Possibly the migration tools fault?
>
> I thought we may be able to get around it using SQL_ASCII encoding -
> but it's ony 7 bit, so would we loose some data? Also our conversion
> utility doesn't have the option to use SQL_ASCII.
>
> Are there any more flexible formats we could use? I noticed we have
> Latin 1-10 and ISO formats. Is there any reason why we shouldn't use
> these?
>
> Thanks
> Glyn

Latin1 is a single byte encoding, i can't think of any reason not to try it
if the characters you have are valid ISO8859 characters. Probably posting
the hex codes of some characters which are failing will help.

> ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
> it
> now.
> http://uk.answers.yahoo.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

--
Usama Munir Dar http://linkedin.com/in/usamadar
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2007-11-30 10:03:38 Re: invalid byte sequence for encoding "UTF8"
Previous Message Ragnar Heil 2007-11-30 09:51:11 Re: Postgres High Availablity Solution needed for hot-standby and load balancing