[unixODBC-support] Query char encoding

Frank A. U. fau at email.com
Sat Jul 27 03:02:59 BST 2013

On Thu, 2013-07-25 at 23:17 +0100, Nick Gorham wrote:
> On 25/07/13 20:06, Frank A. U. wrote:
> > Hello,
> >
> > Lets say the application decides to use the ANSI API.  How does the
> > application know what the char encoding is?
> It doesnt.
> >
> > I'd think that there's an API for querying this information or telling
> > ODBC what encoding the application wants.
> Well, you might think that, but TBH, ODBC is not from a time where there 
> were char encodings, the idea was that if you wanted unicode you used 
> the W functions and all was well. Those were the days :-)

Ok lets try to make me understand better.  So there's no way for the
application to query (control) from the ODBC API what char encoding is
in place when it wants to communicate with a data source.

Does this mean that the encoding solely depends on the driver and
possibly how it (and the back end database) is setup?

In this case the application writer would have to know what the target
database is and investigate there to find out what the encoding is for
the ANSI and wide APIs?


More information about the unixODBC-support mailing list