Re: Problem with character encodings.

Поиск
Список
Период
Сортировка
От Hilton Perantunes
Тема Re: Problem with character encodings.
Дата
Msg-id b24a8cca0708301442o46fb2b1cl9c006b600351d4e7@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Problem with character encodings.  (Ivo Rossacher <rossacher@bluewin.ch>)
Список pgsql-interfaces
I also had similar problems with encoding. I'm using libpqxx, and as Ivo stated, I need do this to get my queries working properly:

    work T(C, "my_transaction");
    T.exec("SET client_encoding = UTF8");
    result R(T.exec("SELECT * FROM my_table_with_portuguese_strings"));

--


On 8/30/07, Ivo Rossacher < rossacher@bluewin.ch> wrote:
Am Mittwoch, 29. August 2007 08:59 schrieb Korumilli, Bala S (GE Healthcare):
If the client_encoding is UTF8 you need to confert the strings in your c++
code to UTF8.
The other options to adjust the client_encoding to the encoding the client
machine uses and let the server convert from and to UTF8 for you. This would
your client program require to anlyze the encoding of the system and send set
client_encoding to '<found encoding>';  to the server.
See chapter 21 in the manual for more details about the issue.

Best regards
Ivo

> But If i write a c++ program using LIBPQ to run this query, I get an error
> of invalid byte sequence like this..
>
> ERROR:  invalid byte sequence for encoding "UTF8".
>
> I also observed the same error comes for all the characters other than
> ascii(0-127). Is it a limitation of LibPQ library?
>
> The follwing information may be helpful to you.
> DataBase encoding: UTF8.
> client_encoding: UTF8
> Postgres version: 8.2.3
>
> Can you please tell me what is the reason for this strange behaviour?

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate



--
Hilton William Ganzo Perantunes
Sistemas de Informação - Universidade Federal de Santa Catarina
--
Dinheiro não traz felicidade, mas dá uma sensação tão parecida...  -_-

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

Предыдущее
От: Ivo Rossacher
Дата:
Сообщение: Re: Problem with character encodings.
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: NAN-Values in ECPG-Code