MyBB Community Forums

Full Version: UTF-8 problem to changed the server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
UTF-8 Problem
I have changed my forum server.
My language is persian (farsi)
Previously i backup of my forum ,
but now when i restored it to new forum, persian texts are unreadable (broken-illegible)



example:
زندگی هنر نقاشی كردن است بدون پاك كردن. پس هميشه چنان زندگی كن كه چون به عقب باز گشتی نياز به پاك كردن نباشد.
Ask your previous server administrator to take a backup of your old forum's database through SSH...

Take a database backup via ssh:

mysqldump --opt -Q -u forum_user -p forum_db > /home/xxxx/public_html/backup.sql
Don't forget that this process requires database password...

Restore the database backup via ssh:

mysql -u forum_user -p forum_db < /home/xxxx/public_html/backup.sql

Change "forum_user, forum_db and xxxx" according to your own settings or custom names...

Even if you don't have an old backup with this way, you can try the second ssh command to upload your present database. Whenever I used this method, there would be never character problems...
You can also export and import databases through PHPMyAdmin which may be an easier option. The tables may be in the wrong collation as there is probably a persian one.
If the thing you posted should have (roughly) read:

زگر اشداست بد پاد پس ازگ بع باز گشتاز بپاداشد.

Then it's a charset problem. UTF-8 interpreted as Latin1.

So this either means you exported the old database as UTF-8 and imported it as Latin1 (solution: import it as UTF-8), or you just have the wrong charset setting on your page (solution: change the charset setting).