define("EW_ENCODING", "utf-8", TRUE);
$encode = EW_ENCODING ;
mysql_set_charset(EW_ENCODING,$con);
$charset = mysql_client_encoding($con);
echo "The current character set is: $charset\n";
Why doesn’t this code print utf-8? When I run this code it actually prints
The current character set is: latin1
How can I get the desired result?
MySQL uses non-standard character set names. Try
utf8without the dash.