I want to save some user input to my database and most of the time this works just fine. However, when the user wants to save the character à
my script returns the following error:
Incorrect string value: '\xC3
I've tried various other characters, such as éúáíó-öđęĨłƕǣʭβۺ-èüòïçÇÈò-èòìù-ÒÌÙÈ À
which all work fine. Even the capitalized À
works fine!
I've googled and, even though I'm pretty sure my character set isn't the problem (all other characters work fine), I made sure everything is UTF-8. With everything I mean: the user input form, the documents, the database connection, the default character sets in my database and the actual columns from the tables in my database.
edit (added php code)
$mysqli = new mysqli($db_server, $db_username, $db_password, $db_database);
$mysqli->set_charset("utf8");
$mysqli->query('SET NAMES utf8');
if ($addToQueue = $mysqli->prepare("INSERT INTO table (html) VALUES (?)")) {
$addToQueue->bind_param('s', $html;);
$html = preg_replace('/\s/u', '', 'àĠӠ');
$addToQueue->execute();
}
What is going on here / am I doing wrong?
Any help is greatly appreciated!