define('SQL_HOST','databasehost');
define('SQL_USER','user');
define('SQL_PASS','password');
define('SQL_DB','databasename');
$conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die('Could not connect to the database; ' . mysql_error());
mysql_select_db(SQL_DB, $conn) or die('Could not select database; ' . mysql_error());
mysql_query("SET NAMES 'utf8'");
Använder mysql_query("SET NAMES 'utf8'");
tar hand om UTF-8. Det fungerade för Devanagari i mitt fall.
Glöm inte att nämna samma kodning i metataggen
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />