I'm trying to encode a string that contains accented uppercase letter like:
$string = "This is a test - À ";
i'm trying to encode using utf8_encode
in this way:
$string = "This is a test - À ";
$encoded = utf8_encode($string);
And returned string is:
"This is a test - ã ";
What function can i use instead utf8_encode
?
EDIT
This string is stored into a table in mysql db.
This is how i connect to database:
$host = "xxxxxx:3306";
$uid = "username";
$pwd = "password";
$dv_database_name = "db_name";
$db_dv = mysql_connect($host, $uid, $pwd);
mysql_query("SET NAMES utf8",$db_dv);
$sql = "...";
$res = mysql_query($sql, $db_dv);
$row = mysql_fetch_array($res);
$string = $row['myField']; // THIS IS THE STRING WITH ACCENTED VALUE