mysql_set_charset
(PHP 5 >= 5.2.3)
Sets the client character set
Note mysqli_set_charsetPDO: Add charset to the connection string, such as charset=utf8
Description
Sets the default character set for the current connection.
Parameters
charsetA valid character set name.
Return Values
Success
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.
See Also
- Setting character sets in MySQL
- List of character sets that MySQL supports
mysql_client_encoding()