am trying to find a way to instruct ODBC drivers – Datadirect ODBC to use win1251 for client session.
There are for ways mentioned in USer Guide:
- Using the \encoding command in psql, which allows you to change client encoding on the fly.
- Using SET client_encoding TO: => SET CLIENT_ENCODING TO ‘value’;
- Using the PGCLIENTENCODING environment variable.
- Setting the configuration parameter client_encoding in the postgresql.conf file
But as far as i understand options 1 and 3 in not suitable for ODBC drivers, option 2 I am also could not use – because i use SAS and this engine doesn’t allow me to execute manually edited SQL’s – it use a lot of automatic codegeneration.
I have tried option client_encoding in postgresql.conf file, moreover I have tired to execute follow clommand in psql admin session: alter user sasuser SET client_encoding to WIN1251; but nothing changes – by default client encoding is still UTF8…
currently in Datadirect ODBC.ini file i have follow string:
IANAAppCodePage=2251
Could somebody help me please?
This should definitely do the trick:
Only remaining explanations can be:
client_encodingis explicitly set to another value.To find out, set
log_statements = all, make the server cluster reload, start a session with your user-unfriendly tool, and check the database log, if and what was actually communicated to the server.Don’t forget to reset
log_statementsor your log files will grow huge.Or it is all just a typo inDatadirect ODBC.ini:That supposed to be 1251?
Nope.
IANAAppCodePage MIBenum 2251stands for “WINDOWS_1251”. That’s not it.