I tried to switch all my content in the database to UTF8 because some characters weren’t showing up. I switched everything in the database, all column collations, tables, etc to
utf8_general_ci. I made sure my header.php specifies the charset as UTF8. I added
AddDefaultCharset UTF-8
to .htaccess. I also ran the query:
SET NAMES utf8
directly in the database. But when I try to load the page I’m getting ??? where Cyrillic should be. I can even see the correct characters in the database. Firefox displays Cyrillic just fine everywhere not on my site, so I can’t figure out what’s wrong.
Do you know the encoding of your server? You can check in your browser what encoding the server is using as it delivers pages. E.g. In Chrome, go to View > Encoding.
Looks like everything is set to UTF-8 and left-to-right. I’ve since exported the database as utf8 and then dropped everything and imported it and that didn’t work. This problem also exists in IE, Firefox, and Chrome.
Temporary workaround I’ve found while waiting to fix the issue, I converted the cyrillic into straight HTML and just put that into the db. Here’s the thing I used to save from having to look up each character. web.forret.com/tools/html.asp
The problem is not in your DB (you’ve covered that). To me, your problem stems from:
the PHP script (.php)
the HTML template (.html)
Make sure BOTH are also UTF-8. For example, in your editor, make sure the “File Settings” is UTF-8 also. If it’s anything other, you’re going to have problems.
Everything must be UTF-8 not just the DB. Remember, the users will be typing stuff into your HTML web forms, and in this case your web form / HTML template should also be UTF-8 as well as add accept-charset=“UTF-8” in your web :
My header has the utf8 charset in there, and I was using Notepad++ set to UFT-8 without BOM, but I can’t figure out how to set the encoding in Brackets.