Sooo when I run a query in phpMyAdmin it results are correct and one of them is “Mikołaj” - as it should be.
But when I try to display the same query results on my website there is “Miko?aj” instead. What should I do?
What has worked for me is urlencodeing the value so the special characters are not stored directly. Then on your website, you can use urldecode to print the characters as they should look.
Using urlencode(), this means that ł becomes %C5%82 in your database, but if you use urldecode(), it will become ł for the browser.
The key issue is that phpMyAdmin uses UTF-8 character encoding, but our PHP setup is not configured to use it by default. We could fix it, but doing so would break many sites in the process, which is why we can’t.
Just not using any non-ASCII characters is one way to go around it. But you could also set the connection charset in your own code to use utf8.