I am having problems displaying foreign characters (characters with accents like: é à ù ç and so on)
The row in the database is like this:
Name | Datatype | Charset
title | varchar(255) | utf8_general_ci
I store it like this:
function inputFilter($var)
{
$var = trim(htmlentities(strip_tags($var)));
if (get_magic_quotes_gpc())
$var = stripslashes($var);
$var = mysql_real_escape_string($var);
return $var;
}
$title = inputFilter($_POST['title']);
and I print it like this:
print $getfromdb['title'];
This is how it's printed out:
Português //Should be: Português
I have tried adding: htmlspecialchars, utf8_decode/encode and htmlentities to the print, although nothing helps!
I've added this to the header:
<meta charset="utf-8">
What am I doing wrong?