pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Client encoding win866.
7+ messages / 2 participants
[nested] [flat]

* Client encoding win866.
@ 2011-06-07 11:04 Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-07 14:39 ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 1 reply; 7+ messages in thread

From: Попов Михаил Юрьевич @ 2011-06-07 11:04 UTC (permalink / raw)
  To: pgsql-odbc

Hi.
Can you please tell me how to change client encoding in ODBC?
I tried after a connection to execute SQLExecDirect (stmthp, "set client_encoding to \" WIN866 \ ";", SQL_NTS) , but the encoding is still a win1251.

PS: The database I have with encoding win866.  Windows 7. PostgreSQL 9.0.4. psqlodbc-09.00.0200.

Mihail Popov.

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Client encoding win866.
  2011-06-07 11:04 Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
@ 2011-06-07 14:39 ` Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-08 11:52   ` Re: Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  0 siblings, 1 reply; 7+ messages in thread

From: Hiroshi Inoue @ 2011-06-07 14:39 UTC (permalink / raw)
  To: Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>; +Cc: pgsql-odbc

(2011/06/07 20:04), Попов Михаил Юрьевич wrote:
> Hi.
>
> Can you please tell me how to change client encoding in ODBC?
>
> I tried after a connection to execute SQLExecDirect (stmthp, "set
> client_encoding to \" WIN866 \ ";", SQL_NTS) , but the encoding is still
> a win1251.

How do you confirm the client_encoding?

regards,
Hiroshi Inoue

> PS: The database I have with encoding win866.  Windows 7. PostgreSQL
> 9.0.4. psqlodbc-09.00.0200.
>
> Mihail Popov.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Client encoding win866.
  2011-06-07 11:04 Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-07 14:39 ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
@ 2011-06-08 11:52   ` Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-08 13:49     ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-09 09:29     ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 2 replies; 7+ messages in thread

From: Попов Михаил Юрьевич @ 2011-06-08 11:52 UTC (permalink / raw)
  To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: pgsql-odbc


>> Hi.
>>
>> Can you please tell me how to change client encoding in ODBC?
>>
>> I tried after a connection to execute SQLExecDirect (stmthp, "set
>> client_encoding to \" WIN866 \ ";", SQL_NTS) , but the encoding is still
>> a win1251.

> How do you confirm the client_encoding?

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"'

regards, Mihail Popov.



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Client encoding win866.
  2011-06-07 11:04 Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-07 14:39 ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-08 11:52   ` Re: Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
@ 2011-06-08 13:49     ` Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-09 09:34       ` Re: Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  1 sibling, 1 reply; 7+ messages in thread

From: Hiroshi Inoue @ 2011-06-08 13:49 UTC (permalink / raw)
  To: Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>; +Cc: pgsql-odbc

(2011/06/08 20:52), Попов Михаил Юрьевич wrote:
>
>>> Hi.
>>>
>>> Can you please tell me how to change client encoding in ODBC?
>>>
>>> I tried after a connection to execute SQLExecDirect (stmthp, "set
>>> client_encoding to \" WIN866 \ ";", SQL_NTS) , but the encoding is still
>>> a win1251.
>
>> How do you confirm the client_encoding?
>
> 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 ...*?

regards,
Hiroshi Inoue





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Client encoding win866.
  2011-06-07 11:04 Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-07 14:39 ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-08 11:52   ` Re: Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-08 13:49     ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
@ 2011-06-09 09:34       ` Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-10 12:40         ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 1 reply; 7+ messages in thread

From: Попов Михаил Юрьевич @ 2011-06-09 09:34 UTC (permalink / raw)
  To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: pgsql-odbc



>> 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?



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Client encoding win866.
  2011-06-07 11:04 Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-07 14:39 ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-08 11:52   ` Re: Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-08 13:49     ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-09 09:34       ` Re: Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
@ 2011-06-10 12:40         ` Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 0 replies; 7+ messages in thread

From: Hiroshi Inoue @ 2011-06-10 12:40 UTC (permalink / raw)
  To: Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>; +Cc: pgsql-odbc

(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




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Client encoding win866.
  2011-06-07 11:04 Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
  2011-06-07 14:39 ` Re: Client encoding win866. Hiroshi Inoue <inoue@tpf.co.jp>
  2011-06-08 11:52   ` Re: Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
@ 2011-06-09 09:29     ` Hiroshi Inoue <inoue@tpf.co.jp>
  1 sibling, 0 replies; 7+ messages in thread

From: Hiroshi Inoue @ 2011-06-09 09:29 UTC (permalink / raw)
  To: Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>; +Cc: pgsql-odbc

(2011/06/08 20:52), Попов Михаил Юрьевич wrote:
>
>>> Hi.
>>>
>>> Can you please tell me how to change client encoding in ODBC?
>>>
>>> I tried after a connection to execute SQLExecDirect (stmthp, "set
>>> client_encoding to \" WIN866 \ ";", SQL_NTS) , but the encoding is still
>>> a win1251.
>
>> How do you confirm the client_encoding?
>
> 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";

Please confirm the database encoding.
Isn't it "WIN1251" not "WIN866"?

regards,
Hiroshi Inoue



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2011-06-10 12:40 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-07 11:04 Client encoding win866. Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
2011-06-07 14:39 ` Hiroshi Inoue <inoue@tpf.co.jp>
2011-06-08 11:52   ` Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
2011-06-08 13:49     ` Hiroshi Inoue <inoue@tpf.co.jp>
2011-06-09 09:34       ` Попов Михаил Юрьевич <Mihail.Popov@galaktika.by>
2011-06-10 12:40         ` Hiroshi Inoue <inoue@tpf.co.jp>
2011-06-09 09:29     ` Hiroshi Inoue <inoue@tpf.co.jp>

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