PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb
void
mysql_get_character_set_info(MYSQL *mysql,
MY_CHARSET_INFO *cs)
此函数提供有关默认客户端字符集的信息。可以使用 mysql_set_character_set()
函数更改默认字符集。
此示例显示了 MY_CHARSET_INFO
结构中可用的字段
if (!mysql_set_character_set(&mysql, "utf8"))
{
MY_CHARSET_INFO cs;
mysql_get_character_set_info(&mysql, &cs);
printf("character set information:\n");
printf("character set+collation number: %d\n", cs.number);
printf("collation name: %s\n", cs.name);
printf("character set name: %s\n", cs.csname);
printf("comment: %s\n", cs.comment);
printf("directory: %s\n", cs.dir);
printf("multi byte character min. length: %d\n", cs.mbminlen);
printf("multi byte character max. length: %d\n", cs.mbmaxlen);
}