I'm trying to move a site and I'm really baffled with the problems I'm having trying to sort out the encoding issues with the database.
The database on new server is using utf8 and all tables imported have utf8. Checking the exported sql file with 'file db.sql' it also says: UTF-8 Unicode text as well as it has it defined in the sql queries in the sql file.
in php.ini I've set default_charset = "UTF-8" and apache.conf I've set AddDefaultCharset UTF-8 as well have I added to the sites-enabled (regular and https) in Apache: AddDefaultCharset UTF-8
In the HTML/PHP document header I have:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
I've checked the PHP documents served by the new web server with 'file' and these as well are: HTML document, UTF-8 Unicode text
Besides all of this, encoding is not correct neither in the mysql client nor when served via the web server. For example, ö becomes ö, å becomes Ã¥ and ä becomes ä. utf8_decode in PHP does display the text properly so it seems to be correct encoding at least?
If someone can give me a hint to where I might have gone wrong it would be greatly appreciated. I'm completely clueless. To me it all seems to have been set to UTF-8 yet these issues persist.
EDIT/add: Response headers when fetching a document from the new server also says: Content-Type text/html; charset=UTF-8
EDIT 2: Stackoverflow suggests that this has already been solved, but I do not find a solution that works from the link provided.