previously OK Unicode text now scrambled (6 posts)

  1. Pinyin
    Posted 3 years ago #

    My blog was hacked some time ago. I've got everything clean again (I hope). But ever since the hack all Chinese characters and letters with diacritics have become scrambled (e.g., the site displays "周有光" instead of "周有光", and "Zhōu YÇ’uguāng" instead of "Zhōu Yǒuguāng").

    If I save the scrambled text in a text file and then force that file to reload as UTF-8 everything displays correctly. But the head of the HTML file is set for "charset=utf-8", so I don't understand what's wrong.


    This problem affect hundreds of posts and hundreds of comments, so I'm anxious to get them un-FUBARed as quickly and simply as possible.

    How can I fix this?


  2. Johnb81
    Posted 3 years ago #

    Check the database encoding in MySQL. Even though you have it specified in the header files, the database might be using different type of encoding. You can access your MySQL database from a phpmyadmin web interface.

  3. Pinyin
    Posted 3 years ago #

    Many thanks. That seems to be it. Somehow the tables in that database (but not in all of my others, for some reason) are now marked as being "latin1_swedish_ci".

    I looked around the phpmyadmin interface but didn't see a way to change them over to utf-8. Any suggestions? I'm afraid I'm just a newbie when it comes to MYSQL.

  4. Johnb81
    Posted 3 years ago #

    Hi Pinyin,

    You can change all the tables by:

    1. Logging in to phpmyadmin
    2. Select the database
    3. navigate to Operations tab
    4. From the Collation drop down menu you can select the encoding.

  5. Pinyin
    Posted 2 years ago #

    Thanks, Johnb81.

    Unfortunately, that didn't work. Perhaps that only affects any new tables in the database. At any rate, it didn't change the pre-existing tables, which are still marked as being Swedish.

  6. WPProHelp
    Posted 2 years ago #

    In this case most probably you have to change the text directly from the MySQL database. Refer to the following:


Topic Closed

This topic has been closed to new replies.

About this Topic