mysql_set_charset

Sets the client character set

&mysql.alternative.note;

- `mysqli_set_charset`
- PDO: Add `charset` to the connection string, such as `charset=utf8`

&reftitle.description; `bool` `mysql_set_charset` `string` `charset` `resource` `link_identifier` NULL

Sets the default character set for the current connection.

&reftitle.parameters;

`charset`

- A valid character set name.

&mysql.linkid.description;
&reftitle.returnvalues;

&return.success;

&reftitle.notes;

This function requires MySQL 5.0.7 or later.

This is the preferred way to change the charset. Using `mysql_query` to set it (such as `SET NAMES utf8`) is not recommended. See the MySQL character set concepts section for more information.

&reftitle.seealso;

- Setting character sets in MySQL
- List of character sets that MySQL supports
- `mysql_client_encoding`