ODBC text encoding API? -
11-20-2006
, 03:43 AM
I need to extract text through ODBC from a variety of database systems
(MySQL, MS SQL, IBM DB2 UDB, Oracle, Sybase ASE, ...). I currently use
a legacy C++ program on Windows for this, and am not very familiar with
ODBC. I've been looking through manuals, web sites, and newsgroups,
but have been unable to figure out how I can determine in an automatic,
database-type-independent way what the encoding is of the text that I
extract.
Different types of databases may provide their own ways of setting or
querying text encodings, but I'd obviously very much prefer using some
API that does not depend on the particular type of database.
I expected that I should be able, through generic ODBC calls, to
either request that the text be returned in an encoding of my choice
(preferably UTF-8, possibly with an error if the requested encoding
cannot be provided), or else to run some database-type-independent
query that tells me what the encoding is of the text that I got. I
don't know how I can do either of these things. Is this even possible?
If so, how can I do it?
Louis Strous |