The mysqli_set_charset() function sets the default
character set (specified by the charset parameter) to be
used when sending data from and to the database server
represented by the link parameter.
Note:
To use this function on a Windows platform you need MySQL client library version 4.1.11
or above (for MySQL 5.0 you need 5.0.6 or above)
/* change character set to utf8 */ if (!$mysqli->set_charset("utf8")) { printf("Error loading character set utf8: %s\n", $mysqli->error); } else { printf("Current character set: %s\n", $mysqli->character_set_name()); }
/* change character set to utf8 */ if (!mysqli_set_charset($link, "utf8")) { printf("Error loading character set utf8: %s\n", mysqli_error($link)); } else { printf("Current character set: %s\n", mysqli_character_set_name($link)); }