I have a swedish website, and whenever I write åäö in the code, it displays as åäö on the site, but when I enter åäö in the database (for exemple a text in the column 'description'), it outputs a square with a question mark on the website.
I have tried the
<meta http-equiv="content-type" content="text/html" charset="UTF8" />
And
<?php header("Content-type: text/html; charset=utf-8");?>
And
SET NAMES 'utf8'
And all possible charsets (it feels like) but it doesn't work.
The MySQL connection collation is utf8_bin and the collation for the table column is utf8_swedish_ci. Help?
EDIT: If I edit the php.ini-file to have
default_charset = "utf8_unicode_ci"
and change the meta to
<meta http-equiv="content-type" content="text/html" charset="UTF-8_general_ci" />
the åäö displays correctly, but the åäö from the code in the files display as ä.
EDIT2: Well, the mysqli_set_charset($connection, 'utf8'); solved my problem.