Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining the Default Character set of a data source?

Status
Not open for further replies.

colmluvu

Programmer
Dec 14, 2006
1
US
Hi ODBC-ers,

I have an ODBC application that can connect to any ODBC enabled back end, and I would like to be able to ask that back-end "what is your default character set", and get back an answer like "utf-8" or "ucs-2" or whatever... The reason I want to do this is because my application uses ucs-2, and if it inserts character data into a back-end that is not ucs-2 enabled (such as mySQL which currently uses utf-8) it will get an exception, so if I know the default character set of the back-end I can translate my character data to utf-8 before I do the insert.

I understand that I can ask an ODBC back-end "what is your default collation sequence?", by using SQL_COLLATION_SEQ with SQLGetInfo, but there is no apparent way for me to get the character set.

Or is there..........?

Many thanks,
Colm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top