Re: Need a way to configure encoding - Mailing list pgsql-odbc

From Dave Cramer
Subject Re: Need a way to configure encoding
Date
Msg-id CADK3HHKuvtH+cFGVr4bEhpoTSjbEAza-im_R9GDGoaGJ1ddx1A@mail.gmail.com
Whole thread Raw
In response to Re: Need a way to configure encoding  (Abhishek Kumar <abhishek.aak0@gmail.com>)
List pgsql-odbc
Greetings,

I think you are using the unicode version of the driver. If you use the non-unicode version it will use the locale settings and strings will be returned as SQL_VARCHAR.

Dave Cramer
www.postgres.rocks


On Tue, 13 Aug 2024 at 05:05, Abhishek Kumar <abhishek.aak0@gmail.com> wrote:
Can someone please help me answer this question?

Regards,
Abhishek Kumar

On Tue, Aug 6, 2024 at 3:01 PM Abhishek Kumar <abhishek.aak0@gmail.com> wrote:
Hi,

I am working on a linux ODBC C++ application and using psqlodbc driver. I need help on the below few questions.

1. Is there a way in which we can make the psqlodbc code work according to the client encoding?
For example, if my application encoding is UTF-8, i would want the types and strings returned to my application in UTF-8. I think by default, it is returning UTF-16 strings.

2. The default behaviour of the driver is when we have a VARCHAR column in a table, it returns SQL_WVARCHAR as the type. Is there a possibility where we can configure something (maybe at connection string), such that it returns SQL_VARCHAR for VARCHAR column and not SQL_WVARCHAR ?

Please help me in answering the above questions.

Regards,
Abhishek Kumar

pgsql-odbc by date:

Previous
From: Abhishek Kumar
Date:
Subject: Re: Need a way to configure encoding
Next
From: Dave Cramer
Date:
Subject: Re: Need a way to configure encoding