You can call the mysql_character_set_name() function to return the name of the default character set of the current connection.
Syntax
const char *
mysql_character_set_name(MYSQL *mysql)
Return values
The name of the default character set is returned.
Errors
None.