Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen?
От | Rural Hunter |
---|---|
Тема | Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen? |
Дата | |
Msg-id | 4F88F684.3030405@gmail.com обсуждение исходный текст |
Ответ на | Re: invalid byte sequence for encoding "UTF8": 0xf481 - how could this happen? (raghu ram <raghuchennuru@gmail.com>) |
Ответы |
Re: invalid byte sequence for encoding "UTF8": 0xf481 - how
could this happen?
|
Список | pgsql-admin |
doesn't work either.<br /><br /> db=# show client_encoding;<br /> client_encoding <br /> -----------------<br /> UTF8<br/> (1 row)<br /><br /> db=# set client_encoding='LATIN1';<br /> SET<br /> db=# show client_encoding;<br /> client_encoding<br /> -----------------<br /> LATIN1<br /> (1 row)<br /><br /> db=# select to_tsvector(content) from tmp_article;<br/> ERROR: invalid byte sequence for encoding "UTF8": 0xf481<br /><br /> 于 2012/4/14 10:15, raghu ram 写道:<blockquote cite="mid:CALnrrJTPzsNvaFP_qHisMS=wwp2bkvK=gk_wPDzC-fdaXEkypA@mail.gmail.com" type="cite"><br /><br /><divclass="gmail_quote">2012/4/14 Rural Hunter <span dir="ltr"><<a href="mailto:ruralhunter@gmail.com" moz-do-not-send="true">ruralhunter@gmail.com</a>></span><br/><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> My db is in utf-8, I have a row in my table say tmp_article and I wantedto generate ts_vector from the article content:<br /> select to_tsvector(content) from tmp_article;<br /> But I gotthis error:<br /> ERROR: invalid byte sequence for encoding "UTF8": 0xf481<br /><br /> I am wondering how this couldhappen. I think if there was invalid UTF8 bytes in the content, it shouldn't have been able to inserted into the tmp_articletable as I sometimes see similar errors when inserting records to tmp_article. Am I right?<span class="HOEnZb"><fontcolor="#888888"><br /><br /></font></span></blockquote><div><br /></div><div><p class="p1">This errorcan also happen if the <span class="s1">byte</span> <span class="s1">sequence</span> does not match the <span class="s1">encoding</span>expected by the server, which is controlled by "client_encoding".</div><div>Try to set client_encoding='LATIN1' </div><div><br/></div><div>and then execute </div></div><div><br /></div> select to_tsvector(content)from tmp_article;<br clear="all" /><div><br /></div> -- <br /><p>Thanks & Regards,<p>Raghu Ram<p>EnterpriseDB:<a href="http://www.enterprisedb.com/" moz-do-not-send="true" target="_blank"><span>http://www.enterprisedb.com</span></a><br/></blockquote><br />
В списке pgsql-admin по дате отправления: