May 2005
Intermediate to advanced
352 pages
14h 39m
English
mysql_character_set_name( )
const char *mysql_character_set_name(MYSQL *mysql)
This returns the name of the default character set in use by the MySQL server.
...
MYSQL *mysql;
const char *char_set;
mysql = mysql_init(NULL);
mysql_connect(mysql,"localhost","russell","password");
char_set = mysql_character_set_name(mysql);
printf("Character Set: %s \n", char_set);
...To get just the character set name, it's not necessary to select a database. Here are what the results of running this program might look like:
Character Set: latin1
Read now
Unlock full access