Search Postgresql Archives

Re: convert(... using windows_1251_to_utf8) - works on cli, but not in a c prog.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexander Farber wrote:
> Hello Alvaro,
> 
> On 12/24/06, Alvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx> wrote:
> >Alexander Farber wrote:
> >> I started to prepare a test case and realized I had a bug.
> >> So convert() works for me, sorry for my previous message!
> >
> >In any case, it's probably saner if you SET client_encoding at the start
> >of the session instead of using convert() everywhere.  The
> >server_encoding should be correctly set to Win1251 though!  (Using
> >SQL_ASCII, while not technically incorrect, is probably not doing you
> >any favor).
> 
> thanks for your comment! I've dropped my db
> and recreated it with encoding set to WIN1251:

Well, what I was suggesting (not explicitely enough, now that I look)
was that you SET client_encoding to UTF8, and then use the query this
way:

> #define SQL_FETCH_USER          \
>    "select username, " \
>    "user_avatar from phpbb_users where user_active = 1 " \
>    "and user_id = $1 and user_password = $2 and user_id not in " \
>    "(select ban_userid from phpbb_banlist where ban_userid is not null)"

Good to hear that it worked anyway.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux