From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Client encoding win866.
Date: Fri, 10 Jun 2011 21:40:53 +0900
Message-ID: <4DF210D5.2020009@tpf.co.jp> (raw)
In-Reply-To: <27EFDA7DA70C1E409421B31ECAA8C9D31DD83EE439@topmail6>
References: <27EFDA7DA70C1E409421B31ECAA8C9D31DD83EDF90@topmail6>
<4DEE3821.8010801@tpf.co.jp>
<27EFDA7DA70C1E409421B31ECAA8C9D31DD83EE285@topmail6>
<4DEF7DF5.6010505@tpf.co.jp>
<27EFDA7DA70C1E409421B31ECAA8C9D31DD83EE439@topmail6>
(2011/06/09 18:34), Попов Михаил Юрьевич wrote:
>
>
>>> Few details...
>>> I create connection and before all the bindings of parameters and columns, and before SQLPrepare I do SQLExecDirect(stmthp,"set client_encoding to \"WIN866\";",SQL_NTS);
>>> Then after SQLPrepare, SQLBindParameter and after SQLExecute I get an error:
>>> Error code 22P05 with message ERROR: character 0x83 of encoding "WIN1251" has no equivalent in "MULE_INTERNAL";
>>>
>>> In this example, the function I pass the 'select * from "Table"'
>
>> What will happen when you don't call *set client_encoding to ...*?
>
> Yes, I understood and found a bug in my code. And now schema by using "set client_encoding to \"WIN866\";" worked correctly. Thanks.
>
> But while I was searching for a solution, I found the documentation and tried it through a variable PGCLIENTENCODING change the encoding.
> http://www.postgresql.org/docs/8.1/static/multibyte.html
> ---
> Using PGCLIENTENCODING. If the environment variable PGCLIENTENCODING is defined in the client's environment, that client encoding is automatically selected when a connection to the server is made. (This can subsequently be overridden using any of the other methods mentioned above.)
>
> Using the configuration variable client_encoding. If the client_encoding variable is set, that client encoding is automatically selected when a connection to the server is made. (This can subsequently be overridden using any of the other methods mentioned above.)
> ---
> I set environment variable at 'WIN866', as well set the database properties "ALTER DATABASE "DD866" SET client_encoding='WIN866'". But it did not work. And without *set client_encoding to ...* don't work.
> This mechanism would be more optimal for my project, because now, for each cursor must run the command *set client_encoding to ...*. Or is this another question?
If you connect via DSN, please look at the page
http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/index.html .
regards,
Hiroshi Inoue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: inoue@tpf.co.jp, Mihail.Popov@galaktika.by
Subject: Re: Client encoding win866.
In-Reply-To: <4DF210D5.2020009@tpf.co.jp>
References: <27EFDA7DA70C1E409421B31ECAA8C9D31DD83EDF90@topmail6> <4DEE3821.8010801@tpf.co.jp> <27EFDA7DA70C1E409421B31ECAA8C9D31DD83EE285@topmail6> <4DEF7DF5.6010505@tpf.co.jp> <27EFDA7DA70C1E409421B31ECAA8C9D31DD83EE439@topmail6> <4DF210D5.2020009@tpf.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox