Skip site navigation (1) Skip section navigation (2)

Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen?

From: raghu ram <raghuchennuru(at)gmail(dot)com>
To: Rural Hunter <ruralhunter(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen?
Date: 2012-04-14 02:15:01
Message-ID: CALnrrJTPzsNvaFP_qHisMS=wwp2bkvK=gk_wPDzC-fdaXEkypA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
2012/4/14 Rural Hunter <ruralhunter(at)gmail(dot)com>

> My db is in utf-8, I have a row in my table say tmp_article and I wanted
> to generate ts_vector from the article content:
> select to_tsvector(content) from tmp_article;
> But I got this error:
> ERROR:  invalid byte sequence for encoding "UTF8": 0xf481
>
> I am wondering how this could happen. I think if there was invalid UTF8
> bytes in the content, it shouldn't have been able to inserted into the
> tmp_article table as I sometimes see similar errors when inserting records
> to tmp_article. Am I right?
>
>
This error can also happen if the byte sequence does not match the
encodingexpected by the server, which is controlled by
"client_encoding".
Try to set client_encoding='LATIN1'

and then execute

select to_tsvector(content) from tmp_article;

-- 

Thanks & Regards,

Raghu Ram

EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

pgsql-admin by date

Next:From: Rural HunterDate: 2012-04-14 04:01:08
Subject: Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen?
Previous:From: Rural HunterDate: 2012-04-14 02:04:48
Subject: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group