The mysqli_character_set_name() function returns the default character set for the database connection.
mysqli_character_set_name(connection);