Ok, this is strange and I don't really know what causes my problem:
Workflow:
- I've a regular mysql database with an utf-8 column.
- I'm inserting rows, via a simple input field, text with german umlauts into this column.
- I'm reading and displaying the rows with a simple query.
My Problem:
Sometimes, and only sometimes, instead of the umlauts question marks are being displayed. What's weird is that it's only with certain words, not all of the umlauts. For instance: "Gummibären" results in a question mark for the "ä" but "Gumibären" (note the single "m") is being displayed correctly. So, I can't really figure out a pattern here.
- The column is in
utf8_general_ci
- The HTML-Files uses the
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- The PHP-File itself is encoded in utf-8
The query is:
mysqli_query("SET NAMES 'utf8'");
$var = "SELECT * FROM table ORDER BY id DESC";
What's also strange is, that the "ä" is not replaced by 1 question mark but 2 question marks, as if there were 2 characters not encoded instead of just 1.
Is there something I'm missing?