Dario V. Fassi wrote:
>
> My problem it's that the data is just inside the postgresql server (with
> SQL_ASCII encoding), inserted by Win32/ODBC clients.
>
> Now from JDBC I can't handle any row with any field that has one o more
> 8 bits characters.
> At same time , Win32/ODBC programs continue to use it without any problem.
> This situation let me in a hard to explain situation.
The problem, as I understand it from Tom's explanation, is that
SQL_ASCII only works if everyone is using the same client_encoding; the
server has no knowledge of the real underlying encoding of the data so
can't do conversions.
JDBC always uses a client_encoding of UNICODE. I don't know what ODBC
does, but apparently it's not using UNICODE.
Perhaps one option is to set the database encoding to UNICODE, and
either get the ODBC driver to issue an appropriate "SET client_encoding"
on connection setup (I don't know if ODBC lets you do this) or set the
default client_encoding in postgresql.conf to whatever is appropriate
for ODBC clients?
-O