Re: libpq - characterset encoding error from selecting BYTEA

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq - characterset encoding error from selecting BYTEA
Дата
Msg-id 18018.1458050231@sss.pgh.pa.us
обсуждение исходный текст
Ответ на libpq - characterset encoding error from selecting BYTEA  (CN <cnliou9@fastmail.fm>)
Ответы Re: libpq - characterset encoding error from selecting BYTEA  (CN <cnliou9@fastmail.fm>)
Список pgsql-interfaces
CN <cnliou9@fastmail.fm> writes:
> PGconn* first switches to "BIG5" client encoding:
> PQexec(conn,"SET CLIENT_ENCODING TO BIG5");

> version 1:

> const char *pValues[]={"5","6"};
> PGresult *r=PQexecParams(conn,"SELECT c3::BYTEA FROM t1 WHERE c1=$1 AND
> c2=$2",2,NULL,pValues,NULL,NULL,1);

> What is strange is that above PQexecParams() works in one portion of my
> program but in another portion it yields the following error:

> ERROR:  character with byte sequence 0x98 0xe1 in encoding "BIG5" has no
> equivalent in encoding "UTF8"

Given the way the complaint is phrased, the problem is with data going
*to* the server, not *from* the server.  I don't think the returned bytea
is your issue at all; it must be either in the SQL query string or the
parameter values being sent.  Probably you should review how you're
setting up the parameter strings.
        regards, tom lane



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: CN
Дата:
Сообщение: libpq - characterset encoding error from selecting BYTEA
Следующее
От: CN
Дата:
Сообщение: Re: libpq - characterset encoding error from selecting BYTEA