Question marks instead of letters

http://retropiano-test.42web.io

Hey, got the problem that my letters in any other language except English are question marks. I made three languages English, Latvian, and Russian. Text is taken from db and rendered on the page, locally it doesn’t cause any problems but here it does.
What could be the solution for this one?

I don’t see any text on that page right now. The HTML just seems to stop half way, and the status code of the page is 500, which means your PHP code crashed. You’ll want to enable Display Errors to see why:

As for the issue itself, it sounds like an encoding issue. By default, our PHP installation uses latin1 encoding, but phpMyAdmin uses utf8. So if you add text with special characters with phpMyAdmin and retrieve it with PHP, it will look mangled.

The best way around this is to make sure you’re always using UTF-8. You can do that with the mysqli_set_charset function or by adding the charset argument to your PDO DSN, depending on which module you use to interact with the database.

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.