The sql_set_charset() function requests the usage of the specified encoding for transactions between PHP and the database manager.

sql_set_charset() accepts three parameters. Only the first is required:

  1. $charset is the requested charset, such as "utf8"
  2. $serveur,
  3. $options.

This function is called immediately after each connection to the database server in order to specify the charset to be employed. This encoding selection is defined elsewhere in the charset_sql_connexion meta variable created during the installation of SPIP.

Author Mark Baber Published : Updated : 17/05/10

Translations : English, français