• When I use WordPress’ recommended method of querying the database $wpdb->get_row($sql) the results are NOT UTF-8 encoded. However, when I run the exact same query manually mysql_fetch_assoc($sql) the results ARE properly UTF-8 encoded.

    To put a finer point on it:
    using $wpdb->get_row($sql) returns:
    ?§???ˉ?—¥???????????—??|????????¨?€????…?§???ˉ?????“??????????€?????€

    using mysql_fetch_assoc($sql) returns:
    私は日本の回していると思う…私は本当にそう思う。

    Any clue how to have wpdb return UTF-8 encoded results?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Baden

    (@baden03)

    Bump. The database is utf-8 encoded. There must be something simple I am missing–any help is greatly appreciated.

    having the same problem – If anyone have a solution, would be greatly appreciated .

    Having the same issue. Did either of you figure it out?

    yes, I did resolved it .
    In my case One of the plugins has a filter that was converting the content from “ISO-8859-1” to “UTF-8” (or viceversa, i can not remember)

    Anyhow , to make sure that this would not happen in the future , I used my own filter to run and check that . I used a littele known php funtcion for character converting called mb_convert_encoding(); like so :

    mb_convert_encoding( $content, "ISO-8859-1", "UTF-8");

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘$wpdb->get_row not returning UTF-8 encoded results’ is closed to new replies.