WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Howto: Display foreign characters in your post/title/comments etc. (2 posts)

  1. scormeny
    Member
    Posted 4 years ago #

    I'm posting this and immediately marking it "resolved" because it is the answer to a question I tried to get answered here in the forums and could not find a satisfactory answer to. I am not a programmer or a DBA so I don't entirely understand what I did to fix my problem, but it did the trick and was easy to accomplish (once you know how to get access to the databases on your web host) and I recommend this solution to others.

    THE PROBLEM: My website is pretty much all English-language, but needs to be able to display some Korean characters that may be submitted in comments or be in the content of the posts and post-titles. However, when we tried to enter anything in Korean, it just came up as question-marks when we hit "save" and would not display on the site.

    THE SOLUTION: Change the settings on my MySQL database so that the character collation/encoding is utf8-general-ci (NOT latin1-swedish-ci).

    HOW I DID IT: First, I used MySQL Administrator to make a backup copy of the database to my desktop computer. Then, I used phpMyAdmin to edit the "Collation" information in several places in my database. It's important to note, for the layperson, that language encoding is set in various places in your database, so you can't just change it in one place and have it work everywhere.

    For myself, I changed the collation for:
    wp_comments and wp_posts (choose to browse each table, then choose "Operations" from the menus across the top, then choose utf8-general-ci from the Collation drop-down menu).

    Then in wp_comments I changed it on the the following fields: comment_author and comment_content (after fixing it under Operations for the table, go to Structure from the menus across the top, and click on the pencil icon for the field you want to edit, and choose utf8-general-ci from the Collation menu).

    Then in wp_posts I followed the same field-editing technique as I did for wp_comments, and edited the collation setting for post_content, post_title and post_excerpt .

    This did not fix the problem on the one comment that had already been submitted to the site in Korean, but it will fix the problem going forward, so that any new foreign characters that are entered on the website should be stored, and appear, properly.

    So far all looks good on my site. This won't be the final fix for everybody's foreign-character problem or localization problem, but it's an easily-overlooked troubleshooting step so I wanted to share it (and remind myself in case the problem comes up again for me on another site!).

  2. scormeny
    Member
    Posted 3 years ago #

    I just had to use this again today -- worked great. I wanted to make one amendment -- the encoding names have underscores, not dashes, in them.

    If you are making these changes in phpMyAdmin, it's not a big deal as you'll select them from a pulldown menu. But if you are making them with SQL, you need to use utf8_general_ci (with underscores) so you don't break anything.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.