WordPress.org

Ready to get started?Download WordPress

Forums

need for correct UTF-8 in database (4 posts)

  1. anatman
    Member
    Posted 8 years ago #

    Hey,

    Just read the topic: http://wordpress.org/support/topic/71527 after searching for an answer to my problem.

    My problem is: i am trying to use Ubernyms ( http://www.huddledmasses.org/jaykul/ubernyms-20/ ), which stores text to be replaced in the DB. The plugin messes up if one uses UTF-8 characters - chinese for example.

    Looking in it's code i found nothing to justify the mess up but the functions update_option() and get_option(), which seem to be WP functions to deal with the DB.

    As i wouldn't expect the plugin author to provide a fix for this, i thought i would ask here: is this a WP bug when dealing with the DB? This may answer a question in the above cited topic as to why one should care about how international characters are stored in the DB as long as they are displayed correctly.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Not a wordpress bug, it's a MySQL thing.

    MySQL databases default to using Latin1 encoding. You need to convert your database to one with UTF-8 encoding.

    You might find this helpful: http://wordpress.org/support/topic/77286?replies=2

    Frankly, this should be the default, IMO.

  3. anatman
    Member
    Posted 8 years ago #

    Very helpful, thank you so much. I will try the solution described there.

    I think i will also file a request in the trak so that the setting for UTF-8 makes WP connect to the DB already in UTF-8.
    I agree, this should be default!

  4. anatman
    Member
    Posted 8 years ago #

    Ok, just to let all know, the solution in the post cited above works. I didn't have to convert my DB, but changing the connection from WP to the database made things work more as expected.

    The problem with ubernyms, though, is not related to this, as i found out later. Ubernyms stores (to this date) the text to be in the tooltips as HTML entities, which is inapropriate to deal with UTF-8. I have posted a comment in the plugin homepage about it.

Topic Closed

This topic has been closed to new replies.

About this Topic