Re: PQexecPrepared() question
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Igor Korot <ikorot01@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>, "David G. Johnston" <david.g.johnston@gmail.com>, "pgsql-generallists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2025-12-22T08:18:57Z
Lists: pgsql-general
On Sun, 2025-12-21 at 11:44 -0800, Igor Korot wrote: > Adding following code: > > SQLHSTMT stmt; > SQLWCHAR value[25]; > ret = SQLAllocHandle( SQL_HANDLE_STMT, m_hdbc, &stmt ); > ret = SQLExecDirect( stmt, L"SHOW client_encoding", SQL_NTS ); > ret = SQLBindCol( stmt, 1, SQL_C_WCHAR, &value, 25, 0 ); > ret = SQLFetch( stmt ); > ret = SQLFreeHandle( SQL_HANDLE_STMT, stmt ); > > the value of the "value" variable is still "UTF8". The ODBC driver comes in a "unicode" and an "ANSI" flavor. If you are using the "unicode" driver, it will always set the client encoding to UTF8. Yours, Laurenz Albe