mysql_get_character_set_info()
void mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *cs)
This function returns the default character set information
for the database given. It uses the MY_CHARSET_INFO
structure, so the information may be retrieved with extensions like
so:
...
if (!mysql_set_character_set(mysql, "utf8"))
{
MY_CHARSET_INFO ch_set;
mysql_get_character_set_info(mysql, &ch_set);
printf("Character Set: %s\n", ch_set.name);
printf("Collation: %s\n", ch_set.csname);
printf("Minimum Length for Multibyte Character: %d\n", ch_set.mbminlen);
printf("Maximum Length for Multibyte Character: %d\n", ch_set.mbmaxlen);
printf("Comment: %s\n", ch_set.comment);
printf("Directory: %s\n", ch_set.dir);
}
...Here are the results of this code excerpt:
Character Set: utf8_general_ci Collation: utf8 Minimum Length for Multibyte Character: 1 Maximum Length for Multibyte Character: 3 Comment: UTF-8 Unicode Directory: (null)