pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
odbc problem on Japanese windows machine
2+ messages / 2 participants
[nested] [flat]

* odbc problem on Japanese windows machine
@ 2007-12-13 13:40  Sofer, Yuval <Yuval_Sofer@bmc.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Sofer, Yuval @ 2007-12-13 13:40 UTC (permalink / raw)
  To: pgsql-admin

Hi, 

 

I am trying to use postgres odbc driver on windows Japanese machine, to
test connection to a remote postgres database. The database has latin1
encoding. 

 

Connection tests to databases with latin1 encoding fail with this error
message: 

 

fatal: conversion between SJIS and LATIN1 is not supported

 

Connection tests to databases with utf8 encoding succeed.

 

I checked both server source and odbc driver source and saw that the
message comes from postgres server code. 

 

It seems that the postgres odbc sends SJIS characters to the latin1
database and it cannot convert.

I know that the next command retrieves with the same error: 

 

alter database <db_name> set client_encoding="SJIS"

 

Is there any switch in the code to bypass local machine encoding?

Why does it send Japanese encoding? 

Postgres odbc driver is not Japanese application. For what the
conversion is needed? 

Is there any way to overcome this problem? 

 

Steps to reproduce error message: 

 

1. Put postgres odbc drivers (psqlodbc30a.dll and psqlodbc35w.dll) under
c:\windows\system32

 

2. Update machine registry with next values: 

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]

"PostgreSQL ANSI"="Installed"

"PostgreSQL Unicode"="Installed"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL ANSI]

"APILevel"="1"

"ConnectFunctions"="YYN"

"Driver"="c:\windows\system32\PSQLODBC30A.DLL"

"DriverODBCVer"="03.00"

"FileUsage"="0"

"Setup"=" c:\windows\system32\PSQLODBC30A.DLL"

"SQLLevel"="1"

"UsageCount"=dword:00000001

 

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL Unicode]

"APILevel"="1"

"ConnectFunctions"="YYN"

"Driver"=" c:\windows\system32\PSQLODBC35W.DLL"

"DriverODBCVer"="03.51"

"FileUsage"="0"

"Setup"=" c:\windows\system32\PSQLODBC35W.DLL"

"SQLLevel"="1"

"UsageCount"=dword:00000001

 

3. Create datasource and test connection to latin1 encoding database: 

Settings -> administrative tools -> data source (ODBC) 

And then add system data source with postgres driver. Configure this
data source to 

connect to latin1 postgres database.

 

Thanks, 

 

Yuval Sofer
BMC Software
CTM&D Business Unit

DBA Team
972-52-4286-282
yuval_sofer@bmc.com <mailto:yuval_sofer@bmc.com> 

 

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

* Re: odbc problem on Japanese windows machine
@ 2007-12-13 18:32  Ivo Rossacher <rossacher@bluewin.ch>
  parent: Sofer, Yuval <Yuval_Sofer@bmc.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Ivo Rossacher @ 2007-12-13 18:32 UTC (permalink / raw)
  To: pgsql-admin

Am Donnerstag, 13. Dezember 2007 14.40:22 schrieb Sofer, Yuval:
> Hi,
>
>
>
> I am trying to use postgres odbc driver on windows Japanese machine, to
> test connection to a remote postgres database. The database has latin1
> encoding.
>
>
>
> Connection tests to databases with latin1 encoding fail with this error
> message:
>
>
>
> fatal: conversion between SJIS and LATIN1 is not supported

In the server manual on chapter 21.2.3 you can find the supported conversions.

>
>
>
> Connection tests to databases with utf8 encoding succeed.
>
>
>
> I checked both server source and odbc driver source and saw that the
> message comes from postgres server code.
>
>
>
> It seems that the postgres odbc sends SJIS characters to the latin1
> database and it cannot convert.
>
> I know that the next command retrieves with the same error:
>
>
>
> alter database <db_name> set client_encoding="SJIS"

According to the manual this is supposed to fail actually.

>
>
>
> Is there any switch in the code to bypass local machine encoding?
>
> Why does it send Japanese encoding?

If I rember correctly the ODBC-Driver does not know or care about the used 
encoding. So it is up to the application to send the desired client_encoding 
to the server. 
The only way to bridge from Latin1 encoded Server to SJIS client seems 
actually the utf8 encoding. So the application would need to be capable to 
deal with utf8. In the connection settings of the ODBC-Driver you could set 
the client_encoding to utf8 if the application does not have this capability. 
Otherwise the application will anyway overwrite the setting. 

Best regards
Ivo

>
> Postgres odbc driver is not Japanese application. For what the
> conversion is needed?
>
> Is there any way to overcome this problem?
>
>
>
> Steps to reproduce error message:
>
>
>
> 1. Put postgres odbc drivers (psqlodbc30a.dll and psqlodbc35w.dll) under
> c:\windows\system32
>
>
>
> 2. Update machine registry with next values:
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
>
> "PostgreSQL ANSI"="Installed"
>
> "PostgreSQL Unicode"="Installed"
>
>
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL ANSI]
>
> "APILevel"="1"
>
> "ConnectFunctions"="YYN"
>
> "Driver"="c:\windows\system32\PSQLODBC30A.DLL"
>
> "DriverODBCVer"="03.00"
>
> "FileUsage"="0"
>
> "Setup"=" c:\windows\system32\PSQLODBC30A.DLL"
>
> "SQLLevel"="1"
>
> "UsageCount"=dword:00000001
>
>
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL Unicode]
>
> "APILevel"="1"
>
> "ConnectFunctions"="YYN"
>
> "Driver"=" c:\windows\system32\PSQLODBC35W.DLL"
>
> "DriverODBCVer"="03.51"
>
> "FileUsage"="0"
>
> "Setup"=" c:\windows\system32\PSQLODBC35W.DLL"
>
> "SQLLevel"="1"
>
> "UsageCount"=dword:00000001
>
>
>
> 3. Create datasource and test connection to latin1 encoding database:
>
> Settings -> administrative tools -> data source (ODBC)
>
> And then add system data source with postgres driver. Configure this
> data source to
>
> connect to latin1 postgres database.
>
>
>
> Thanks,
>
>
>
> Yuval Sofer
> BMC Software
> CTM&D Business Unit
>
> DBA Team
> 972-52-4286-282
> yuval_sofer@bmc.com <mailto:yuval_sofer@bmc.com>





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


end of thread, other threads:[~2007-12-13 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-12-13 13:40 odbc problem on Japanese windows machine Sofer, Yuval <Yuval_Sofer@bmc.com>
2007-12-13 18:32 ` Ivo Rossacher <rossacher@bluewin.ch>

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