MyBB Community Forums

Full Version: Character encoding problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, we upgraded to 1.6.8 version but we are having character encoding issues. We checked in database and everything there is correctly. We also shut down gzip, but when you visit forum, there are still weird characters (the same ones that are correct in database; just to explain, I queried some incorrectly displayed topics and they are normally written in database, they re just wrong when visiting page).

All tables are to utf-8, everything is utf-8 (languages too) and there is a UTF-8 character encoding in header of each page on forum.

I am kinda out of ideas how to fix this, and would like to fix that before opening forum again for users. We are fighting with this second day already and would be neat if we can get some hints or tips what to do. Thanks in advance.

Forum: http://forum.ubuntu-rs.org but it is closed until we fix it and everything else that might pop up.
Any chance you could post a screenshot? Also, would you happen to be using Google chrome? I had a similar issue in chrome about a year back.
(2012-06-25, 09:20 AM)euantor Wrote: [ -> ]Any chance you could post a screenshot? Also, would you happen to be using Google chrome? I had a similar issue in chrome about a year back.

Here it is:
http://www.dodaj.rs/f/1s/fA/2sgVuslW/pic5.png

I m using Firefox 12.
I also started now new import of database and forced there charset utf8 ( SET NAMES utf8;, create database db_name DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci) in hope that might fix a problem.
I see what you mean. Importing the database won't do anything I believe, but maybe the character set shouldn't be utf-8 anyway? I'm no expert on character encoding or anything but I believe it doesn't support certain foreign characters.
I tried to force ISO-8859-1, ISO-8859-15 and ISO-8859-16 (which should cover Serbian language) through .htaccess but no luck. And if I change from UTF-8, then Google SEO module is reporting it as a warning. Since it manages links of forum, I wasn't sure if I should mess up with changing now everything from UTF-8 to something else.

When I set Latin1 (I think full was latin1_swedish_ci), I see all letters perfect, but then none of the links work (probably because of that module). It would be perfect if I could match earlier version with this new and check encoding settings but that is now not possible unfortunately by the human error...
Sounds like the latin encoding system is the one you'll have to go for unfortunately. I believe Google SEO has a workaround that converts special characters though. Try enabling that in the settings and see if it helps.
I just want to say that this new db import succeeded and fixed the problem we had. Thanks a lot for your support and trying to help! I will mark this as solved andrepeat below what we did to fix it, in case someone else stumbles on the same problem.

Fix that worked:
  • Dump DB to have backup before you start work: mysql -u root -p db_name > db_db_name_date.sql
  • Now log in to mysql: mysql -u root -p
  • drop DB you dumped previously: drop database db_name; <- please understand well what all commands, and especially this one does!!!! Do not use until you do a research or you might loose your data forever
  • SET NAMES utf8;
  • \u db_name
  • create database db_name DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci
  • \. name_of_backup_file_that_you_want_to_import_and_know_it_is_the_last_working_dump.sql
  • Wait to complete import and then check if all is ok.
Glad it's all sorted. I really didn't think that would work but it just goes to show I was wrong Wink Thanks for posting the steps for the fix too.